Make a panic message more informative if binary files are accidentally created somewhere in the test folder

This commit is contained in:
Oli Scherer 2023-08-07 09:42:24 +00:00
parent 4c779da913
commit 0afd38b093

View File

@ -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());