mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Fix clippy::expect_fun_call
This commit is contained in:
parent
b9af1d7c42
commit
63e37f9536
1 changed files with 1 additions and 1 deletions
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue