commit | f2ea97bd814cc806114adf5c96250a4076346fe9 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Tue Jan 31 20:17:52 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jan 31 20:17:52 2023 +0000 |
tree | cd05acbe09b8ff210d8f290e531031b366a01b0f | |
parent | 4c8aa93e2b03485021318cd8f16a57f57faf9419 [diff] | |
parent | 015a425044fc60f044d2f0f19e2281b8d78eeacf [diff] |
Update TEST_MAPPING am: 7b3816f38c am: 015a425044 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2411866 Change-Id: I1b1ec42a1df12f29a07a6a4f6fa06c30da95725d 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.