Skip to content

Commit

Permalink
Make a panic message more informative if binary files are accidentall…
Browse files Browse the repository at this point in the history
…y created somewhere in the test folder
  • Loading branch information
oli-obk committed Aug 3, 2023
1 parent 5b33008 commit f58e25e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn old_test_headers() {
continue;
}

let file = fs::read_to_string(entry.path()).unwrap();
let file = fs::read_to_string(entry.path()).unwrap_or_else(|err| panic!("{}: {err}", entry.path().display()));

if let Some(header) = old_headers.find(&file) {
println!("Found header `{}` in {}", header.as_str(), entry.path().display());
Expand Down

0 comments on commit f58e25e

Please sign in to comment.