diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 7f55779cf0..8bb3b3937f 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -318,7 +318,7 @@ pub fn project_dir() -> PathBuf { /// so this should always be correct. pub fn read_text(path: &Path) -> String { fs::read_to_string(path) - .expect(&format!("File at {:?} should be valid", path)) + .unwrap_or_else(|_| panic!("File at {:?} should be valid", path)) .replace("\r\n", "\n") }