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 | |
parent | 8b6eb89f36d32d6c35dea1710c284856b67b9293 (diff) | |
download | which-e92abd30fa7f0b5a710c5b5ee30052f63efffb33.tar.gz |
Upgrade rust/crates/which to 4.0.2
Change-Id: Ia00f7a794e0eb6b3239f171d216675ee6cb02003
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | src/checker.rs | 9 |
5 files changed, 12 insertions, 9 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index eb684ab..a84fc42 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "e5039c15d1202a59b9e35d628263134cf92514fe" + "sha1": "b5ab0940278ff0e5a5f864a4138098f5fbd9d868" } } @@ -12,7 +12,7 @@ [package] name = "which" -version = "4.0.1" +version = "4.0.2" authors = ["Harry Fei <tiziyuanfang@gmail.com>"] description = "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms." documentation = "https://docs.rs/which/" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 34399d6..20f06bf 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "which" -version = "4.0.1" +version = "4.0.2" authors = ["Harry Fei <tiziyuanfang@gmail.com>"] repository = "https://github.com/harryfei/which-rs.git" documentation = "https://docs.rs/which/" @@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/harryfei/which-rs.git" } - version: "4.0.1" + version: "4.0.2" license_type: NOTICE last_upgrade_date { year: 2020 - month: 7 - day: 10 + month: 8 + day: 4 } } 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()) |