commit | 8e29bf522994601897ea54df48eedf9cb455e787 | [log] [tgz] |
---|---|---|
author | David LeGare <legare@google.com> | Fri Apr 22 09:24:06 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Apr 22 09:24:06 2022 +0000 |
tree | 74b760abd18f993e3501cabf9342ccb8d6b484f5 | |
parent | 8a13ffa045d80c5dee9335001e686c2d598bdc19 [diff] | |
parent | dd6233041ca44c4d1dad2a0e46054a10fd0635f7 [diff] |
Upgrade rust/crates/which to 4.2.5 am: d9d261bae5 am: 7663b7b515 am: d4c1d30894 am: 3bdf596710 am: dd6233041c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2066750 Change-Id: Ia05012c1e1ff6aa04bc710b167be590227ec0cf1 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.