commit | c43ae3e55a4e8deffcc7515df9a60e50f1fb0ce6 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Tue May 31 19:06:02 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 31 19:06:02 2022 +0000 |
tree | 6e5a02546474dd4d8ceb323c4ca0261e1c5f435c | |
parent | 8e29bf522994601897ea54df48eedf9cb455e787 [diff] | |
parent | 4114547a4f5b77be0ad1e34668ea626f434f7378 [diff] |
Update TEST_MAPPING am: 1667723bb6 am: 099f81a5ba am: a16491ef07 am: f2d8840636 am: 4114547a4f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2107134 Change-Id: I5e33bfee37034f662b283b2fc73595b439acf896 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.