Skip to content

Commit

Permalink
Add a couple comments (#617)
Browse files Browse the repository at this point in the history
As I'm trying to understand parts of the code
  • Loading branch information
max-sixty authored Sep 26, 2024
1 parent 0c239ca commit afd4d20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion insta/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl std::str::FromStr for UnreferencedSnapshots {
}
}

/// Memoizes a snapshot file in the reference file.
/// Memoizes a snapshot file in the reference file, as part of removing unreferenced snapshots.
pub fn memoize_snapshot_file(snapshot_file: &Path) {
if let Ok(path) = env::var("INSTA_SNAPSHOT_REFERENCES_FILE") {
let mut f = fs::OpenOptions::new()
Expand Down
2 changes: 1 addition & 1 deletion insta/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ pub fn assert_snapshot(
let new_snapshot =
ctx.new_snapshot(SnapshotContents::new(new_snapshot_value.into(), kind), expr);

// memoize the snapshot file if requested.
// memoize the snapshot file if requested, as part of potentially removing unreferenced snapshots
if let Some(ref snapshot_file) = ctx.snapshot_file {
memoize_snapshot_file(snapshot_file);
}
Expand Down

0 comments on commit afd4d20

Please sign in to comment.