commit | 67111d64ebf07d5769ac580b6695b21cbb757c3b | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Fri Feb 17 21:09:04 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Feb 17 21:09:04 2023 +0000 |
tree | 8d776c48ca763a8a92725842792c44c68bd6d5b0 | |
parent | f2ea97bd814cc806114adf5c96250a4076346fe9 [diff] | |
parent | 26caf7138b86de0a9aa5fbb388eb1971bed964fb [diff] |
Upgrade which to 4.4.0 am: a065455574 am: 26caf7138b Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2441940 Change-Id: Id2691086307858ea6299725333a559b602a793e8 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.