Fix clippy::expect_fun_call

This commit is contained in:
Alan Du 2019-06-03 10:13:19 -04:00
parent b9af1d7c42
commit 63e37f9536

View file

@ -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")
}