diff --git a/insta/src/snapshot.rs b/insta/src/snapshot.rs index 0130f546..a11ca207 100644 --- a/insta/src/snapshot.rs +++ b/insta/src/snapshot.rs @@ -424,7 +424,6 @@ impl Snapshot { )) } - /// Creates an empty snapshot. pub(crate) fn from_components( module_name: String, snapshot_name: Option, @@ -604,8 +603,10 @@ impl Snapshot { /// Same as [`Self::save`] but instead of writing a normal snapshot file this will write /// a `.snap.new` file with additional information. /// - /// The name of the new snapshot file is returned. + /// The path of the new snapshot file is returned. pub(crate) fn save_new(&self, path: &Path) -> Result> { + // TODO: should we be the actual extension here rather than defaulting + // to the standard `.snap`? let new_path = path.to_path_buf().with_extension("snap.new"); self.save_with_metadata(&new_path, &self.metadata)?; Ok(new_path)