commit | 4114547a4f5b77be0ad1e34668ea626f434f7378 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Tue May 31 17:58:56 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue May 31 17:58:56 2022 +0000 |
tree | 6e5a02546474dd4d8ceb323c4ca0261e1c5f435c | |
parent | dd6233041ca44c4d1dad2a0e46054a10fd0635f7 [diff] | |
parent | f2d8840636d73edc29355c46ed8aa65e9aa6c4b2 [diff] |
Update TEST_MAPPING am: 1667723bb6 am: 099f81a5ba am: a16491ef07 am: f2d8840636 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2107134 Change-Id: I66dd534520c954ebbabed9f68786247e0e9d8337 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.