commit | cdafc38ec0cca141ca25b1601d24e2446152c6e5 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Tue Jan 31 21:31:54 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 31 21:31:54 2023 +0000 |
tree | cd05acbe09b8ff210d8f290e531031b366a01b0f | |
parent | 21b57c3b5b3d8371a5c19489f9568fc2f99c644b [diff] | |
parent | f2ea97bd814cc806114adf5c96250a4076346fe9 [diff] |
Update TEST_MAPPING am: 7b3816f38c am: 015a425044 am: f2ea97bd81 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2411866 Change-Id: Ie8f645ceb957d7da6e0e9b26f73fe530f8e4b5dc 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.