aboutsummaryrefslogtreecommitdiff
path: root/src/finder.rs
diff options
context:
space:
mode:
authorDavid LeGare <legare@google.com>2022-04-22 02:53:52 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-22 02:53:52 +0000
commit3bdf5967102e0c36908acb09c4624cac6fb9bb65 (patch)
tree74b760abd18f993e3501cabf9342ccb8d6b484f5 /src/finder.rs
parent90fdb407fc7b3314cccbf6638cbd48adb9da84d7 (diff)
parentd4c1d30894a088302899a90daa356543e885ffbf (diff)
downloadwhich-3bdf5967102e0c36908acb09c4624cac6fb9bb65.tar.gz
Upgrade rust/crates/which to 4.2.5 am: d9d261bae5 am: 7663b7b515 am: d4c1d30894
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2066750 Change-Id: Ic1689d8c7f1e521f0f0eb779b952e3208a2a7464 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/finder.rs')
-rw-r--r--src/finder.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/finder.rs b/src/finder.rs
index 43b659d..9b64294 100644
--- a/src/finder.rs
+++ b/src/finder.rs
@@ -94,6 +94,9 @@ impl Finder {
T: AsRef<OsStr>,
{
let p = paths.ok_or(Error::CannotFindBinaryPath)?;
+ // Collect needs to happen in order to not have to
+ // change the API to borrow on `paths`.
+ #[allow(clippy::needless_collect)]
let paths: Vec<_> = env::split_paths(&p).collect();
let matching_re = paths
@@ -169,7 +172,7 @@ impl Finder {
})
// PATHEXT not being set or not being a proper Unicode string is exceedingly
// improbable and would probably break Windows badly. Still, don't crash:
- .unwrap_or(vec![]);
+ .unwrap_or_default();
}
paths