Rollup merge of #85044 - ChrisDenton:file-exists, r=jackh726
Use `path.exists()` instead of `fs::metadata(path).is_ok()` It's more explicit and potentially allows platforms to optimize the existence check.
This commit is contained in:
commit
b5092627c7
2 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ pub struct RealFileLoader;
|
|||
|
||||
impl FileLoader for RealFileLoader {
|
||||
fn file_exists(&self, path: &Path) -> bool {
|
||||
fs::metadata(path).is_ok()
|
||||
path.exists()
|
||||
}
|
||||
|
||||
fn read_file(&self, path: &Path) -> io::Result<String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue