commit | a065455574fc17a5ddd2149526dcaf8a13556a07 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Fri Feb 17 09:52:07 2023 +0100 |
committer | Jeff Vander Stoep <jeffv@google.com> | Fri Feb 17 09:52:07 2023 +0100 |
tree | 8d776c48ca763a8a92725842792c44c68bd6d5b0 | |
parent | 7b3816f38c354e37a6c4cdb997c2d263814499db [diff] |
Upgrade which to 4.4.0 This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/which For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I9ff5e0aaffe13044c1ecff0f5785e1c24e4449b4
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.