Skip to content

Commit

Permalink
Ensure snapshots formatted with rustfmt use unix newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Feb 15, 2023
1 parent 48f8f77 commit 48f044e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ All notable changes to insta and cargo-insta are documented here.

- Added `allow_duplicates!` to enable multiple assertions for a
single snapshot. (#346)
- Ensure that expressions formatted with `rustfmt` use unix newlines.

## 1.27.0

Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Expand Up @@ -100,7 +100,7 @@ pub fn format_rust_expression(value: &str) -> Cow<'_, str> {
let end = output.stdout.len() - SUFFIX.len();
return std::str::from_utf8(&output.stdout[start..end])
.unwrap()
.to_owned()
.replace("\r\n", "\n")
.into();
}
}
Expand Down

0 comments on commit 48f044e

Please sign in to comment.