diff options
author | Haibo Huang <hhb@google.com> | 2020-08-04 15:10:40 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-08-04 15:10:40 -0700 |
commit | e92abd30fa7f0b5a710c5b5ee30052f63efffb33 (patch) | |
tree | f9e759189ab9277788562b2f088a6a4248120174 /src/checker.rs | |
parent | 8b6eb89f36d32d6c35dea1710c284856b67b9293 (diff) | |
download | which-e92abd30fa7f0b5a710c5b5ee30052f63efffb33.tar.gz |
Upgrade rust/crates/which to 4.0.2
Change-Id: Ia00f7a794e0eb6b3239f171d216675ee6cb02003
Diffstat (limited to 'src/checker.rs')
-rw-r--r-- | src/checker.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/checker.rs b/src/checker.rs index 817ae2f..94ef31a 100644 --- a/src/checker.rs +++ b/src/checker.rs @@ -39,14 +39,17 @@ impl ExistedChecker { } impl Checker for ExistedChecker { - #[cfg(target_os="windows")] + #[cfg(target_os = "windows")] fn is_valid(&self, path: &Path) -> bool { fs::symlink_metadata(path) - .map(|metadata| metadata.is_file()) + .map(|metadata| { + let file_type = metadata.file_type(); + file_type.is_file() || file_type.is_symlink() + }) .unwrap_or(false) } - #[cfg(not(target_os="windows"))] + #[cfg(not(target_os = "windows"))] fn is_valid(&self, path: &Path) -> bool { fs::metadata(path) .map(|metadata| metadata.is_file()) |