aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-08-11 02:09:45 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-08-11 02:09:45 +0000
commit3dc1fe3e15cb5251fe02f9e97d8c6d34d9bc16af (patch)
treef9e759189ab9277788562b2f088a6a4248120174
parent6abc81d54074f9dac08db0a0bec8181f3301f5ee (diff)
parent1590b9b99c80bb0de09bc7f8eb4e0f014f20e65a (diff)
downloadwhich-3dc1fe3e15cb5251fe02f9e97d8c6d34d9bc16af.tar.gz
Upgrade rust/crates/which to 4.0.2 am: e92abd30fa am: 9b29c40588 am: ebb606a7fb am: 1590b9b99c
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/1388913 Change-Id: Iec66ddae85ac81817bb400b204120d349c7db4e8
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA6
-rw-r--r--src/checker.rs9
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"
}
}
diff --git a/Cargo.toml b/Cargo.toml
index d5f14ac..0ba7115 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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/"
diff --git a/METADATA b/METADATA
index 6c5876e..62667a6 100644
--- a/METADATA
+++ b/METADATA
@@ -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())