commit | dd6233041ca44c4d1dad2a0e46054a10fd0635f7 | [log] [tgz] |
---|---|---|
author | David LeGare <legare@google.com> | Fri Apr 22 03:36:33 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Apr 22 03:36:33 2022 +0000 |
tree | 74b760abd18f993e3501cabf9342ccb8d6b484f5 | |
parent | 90fdb407fc7b3314cccbf6638cbd48adb9da84d7 [diff] | |
parent | 3bdf5967102e0c36908acb09c4624cac6fb9bb65 [diff] |
Upgrade rust/crates/which to 4.2.5 am: d9d261bae5 am: 7663b7b515 am: d4c1d30894 am: 3bdf596710 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2066750 Change-Id: I26e919c186ed3b0b814e5cb5d5c7fa7ae91995dd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
A Rust equivalent of Unix command “which”. Locate installed executable in cross platforms.
To find which rustc executable binary is using.
use which::which; let result = which("rustc").unwrap(); assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
After enabling the regex
feature, find all cargo subcommand executables on the path:
use which::which_re; which_re(Regex::new("^cargo-.*").unwrap()).unwrap() .for_each(|pth| println!("{}", pth.to_string_lossy()));
The documentation is available online.