Skip to content

Commit f58e25e

Browse files
committed
Make a panic message more informative if binary files are accidentally created somewhere in the test folder
1 parent 5b33008 commit f58e25e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/headers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn old_test_headers() {
1616
continue;
1717
}
1818

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

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

0 commit comments

Comments
 (0)