Skip to content

Commit

Permalink
Update a couple docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Oct 13, 2024
1 parent 083ce14 commit 640bdfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions insta/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ impl Snapshot {
buf
}

// We take `md` as an argument here because the calling methods want to
// adjust it; e.g. removing volatile fields when writing to the final
// `.snap` file.
fn save_with_metadata(&self, path: &Path, md: &MetaData) -> Result<(), Box<dyn Error>> {
if let Some(folder) = path.parent() {
fs::create_dir_all(folder)?;
Expand All @@ -592,9 +595,6 @@ impl Snapshot {
}

/// Saves the snapshot.
///
/// Returns `true` if the snapshot was saved. This will return `false` if there
/// was already a snapshot with matching contents.
#[doc(hidden)]
pub fn save(&self, path: &Path) -> Result<(), Box<dyn Error>> {
self.save_with_metadata(path, &self.metadata.trim_for_persistence())
Expand Down

0 comments on commit 640bdfd

Please sign in to comment.