summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-05-08 01:06:26 +0200
committerGitHub <noreply@github.com>2021-05-08 01:06:26 +0200
commitb5092627c75cde5c5bb99a1850633baf9aedd1a4 (patch)
treecbf524ef27e3f5d4140a3a435c9f09cb74ff9196 /compiler/rustc_codegen_ssa/src
parentb4a00205d8487379c3534b72ecdf0d4d453b4a86 (diff)
parentd9a58f4c87acce4c413b6bfb93916823bafbd68b (diff)
downloadrust-b5092627c75cde5c5bb99a1850633baf9aedd1a4.tar.gz
rust-b5092627c75cde5c5bb99a1850633baf9aedd1a4.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs2
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 929bdf22755..cb3c98354c8 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -772,7 +772,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);
         }
     }