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