commit | f2d8840636d73edc29355c46ed8aa65e9aa6c4b2 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Tue May 31 17:23:49 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 31 17:23:49 2022 +0000 |
tree | 6e5a02546474dd4d8ceb323c4ca0261e1c5f435c | |
parent | 3bdf5967102e0c36908acb09c4624cac6fb9bb65 [diff] | |
parent | a16491ef079e845887151d243d8d39f8aac46342 [diff] |
Update TEST_MAPPING am: 1667723bb6 am: 099f81a5ba am: a16491ef07 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2107134 Change-Id: I915d795d638967804cccf525bb031e8e15d36e9a 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.