Skip to content

Commit

Permalink
Do not emit extra newline after metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jan 28, 2022
1 parent c65999a commit f0717da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to insta and cargo-insta are documented here.

## 1.13.0

- Fixed a bug where an extra newline was emitted following the snapshot header.

## 1.12.0

- Add support for sorting redactions (`sorted_redaction` and `Settings::sort_selector`). (#212)
Expand Down
2 changes: 1 addition & 1 deletion src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl Snapshot {
}
let mut f = fs::File::create(&path)?;
serde_yaml::to_writer(&mut f, &self.metadata)?;
f.write_all(b"\n---\n")?;
f.write_all(b"---\n")?;
f.write_all(self.contents_str().as_bytes())?;
f.write_all(b"\n")?;
Ok(())
Expand Down

0 comments on commit f0717da

Please sign in to comment.