diff options
| author | Chris Denton <christophersdenton@gmail.com> | 2021-05-07 17:32:40 +0100 |
|---|---|---|
| committer | Chris Denton <christophersdenton@gmail.com> | 2021-05-07 17:32:40 +0100 |
| commit | d9a58f4c87acce4c413b6bfb93916823bafbd68b (patch) | |
| tree | 6e47561c4a6448778ca9299b1fe68ca1dcd58195 /compiler/rustc_codegen_ssa/src | |
| parent | e5f83d24aee866a14753a7cedbb4e301dfe5bef5 (diff) | |
| download | rust-d9a58f4c87acce4c413b6bfb93916823bafbd68b.tar.gz rust-d9a58f4c87acce4c413b6bfb93916823bafbd68b.zip | |
Use `path.exists()` instead of `fs::metadata(path).is_ok()`
It's more explicit and allows platforms to optimize the existence check.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/linker.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 401d379b0d1..fecea9f952b 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -764,7 +764,7 @@ impl<'a> Linker for MsvcLinker<'a> { // check to see if the file is there and just omit linking to it if it's // not present. let name = format!("{}.dll.lib", lib); - if fs::metadata(&path.join(&name)).is_ok() { + if path.join(&name).exists() { self.cmd.arg(name); } } |
