commit | 93a6d69a621eeeccea181050af3a8ca5c2771afe | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Mon Dec 19 12:00:50 2022 +0100 |
committer | Jeff Vander Stoep <jeffv@google.com> | Mon Dec 19 12:04:25 2022 +0100 |
tree | 2d4886bf255b23ca0235d30cb548c6f036f3fc1f | |
parent | 9c0bb67e1f1066b6882c338f9c6e5df295bd610b [diff] |
Upgrade which to 4.3.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: Iedee7f8b500cb8413c53ac78ca61e378a77ea427
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.