commit | 26194f8259fecfb8ae278c1b918496a3e09fd650 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Thu Jun 16 00:20:29 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Jun 16 00:20:29 2022 +0000 |
tree | 74b760abd18f993e3501cabf9342ccb8d6b484f5 | |
parent | c43ae3e55a4e8deffcc7515df9a60e50f1fb0ce6 [diff] | |
parent | 9c0bb67e1f1066b6882c338f9c6e5df295bd610b [diff] |
Merge "Update TEST_MAPPING" am: 4ecdb53961 am: 238dc9d855 am: a24c6972f5 am: 536d105196 am: 9c0bb67e1f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2126455 Change-Id: Ieec1efbe2cb65f5bd343c46da2da9b7a8eaafae7 Signed-off-by: Automerger Merge Worker <[email protected]>
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.