commit | a24c6972f58a35254904fea36d731c54d1f10a26 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Jun 15 21:00:40 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 15 21:00:40 2022 +0000 |
tree | 74b760abd18f993e3501cabf9342ccb8d6b484f5 | |
parent | a16491ef079e845887151d243d8d39f8aac46342 [diff] | |
parent | 238dc9d855e264a72c714fe3c7fbaaa43c7e1878 [diff] |
Merge "Update TEST_MAPPING" am: 4ecdb53961 am: 238dc9d855 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2126455 Change-Id: I89cf7d13c393413c3ee18140c872819aa0b99d8d 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.