Use path.exists()
instead of fs::metadata(path).is_ok()
It's more explicit and allows platforms to optimize the existence check.
This commit is contained in:
parent
e5f83d24ae
commit
d9a58f4c87
@ -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
|
// check to see if the file is there and just omit linking to it if it's
|
||||||
// not present.
|
// not present.
|
||||||
let name = format!("{}.dll.lib", lib);
|
let name = format!("{}.dll.lib", lib);
|
||||||
if fs::metadata(&path.join(&name)).is_ok() {
|
if path.join(&name).exists() {
|
||||||
self.cmd.arg(name);
|
self.cmd.arg(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ pub struct RealFileLoader;
|
|||||||
|
|
||||||
impl FileLoader for RealFileLoader {
|
impl FileLoader for RealFileLoader {
|
||||||
fn file_exists(&self, path: &Path) -> bool {
|
fn file_exists(&self, path: &Path) -> bool {
|
||||||
fs::metadata(path).is_ok()
|
path.exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_file(&self, path: &Path) -> io::Result<String> {
|
fn read_file(&self, path: &Path) -> io::Result<String> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user