diff options
author | Haibo Huang <hhb@google.com> | 2020-08-11 01:14:07 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-11 01:14:07 +0000 |
commit | 9b29c40588eef2bcbea1def9c855b818c36c67dd (patch) | |
tree | f9e759189ab9277788562b2f088a6a4248120174 | |
parent | ed9bfb672be8928aa0723b6c03d30457e8942acf (diff) | |
parent | e92abd30fa7f0b5a710c5b5ee30052f63efffb33 (diff) | |
download | which-9b29c40588eef2bcbea1def9c855b818c36c67dd.tar.gz |
Upgrade rust/crates/which to 4.0.2 am: e92abd30fa
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/1388913
Change-Id: I0fc9ef7e246894e532ca7e41e9308e0e2424d0fa
-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()) |