From 63e37f95366131359282186286664b7b70038844 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Mon, 3 Jun 2019 10:13:19 -0400 Subject: [PATCH] Fix clippy::expect_fun_call --- crates/test_utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") }