From d9a58f4c87acce4c413b6bfb93916823bafbd68b Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Fri, 7 May 2021 17:32:40 +0100 Subject: Use `path.exists()` instead of `fs::metadata(path).is_ok()` It's more explicit and allows platforms to optimize the existence check. --- compiler/rustc_codegen_ssa/src/back/linker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_ssa/src') 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); } } -- cgit 1.4.1-3-g733a5