commit | 015a425044fc60f044d2f0f19e2281b8d78eeacf | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Tue Jan 31 19:16:09 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 31 19:16:09 2023 +0000 |
tree | cd05acbe09b8ff210d8f290e531031b366a01b0f | |
parent | 4c8aa93e2b03485021318cd8f16a57f57faf9419 [diff] | |
parent | 7b3816f38c354e37a6c4cdb997c2d263814499db [diff] |
Update TEST_MAPPING am: 7b3816f38c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2411866 Change-Id: I832107ee77345c5a942e9dfa18edb0aac5610bd8 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.