commit | 21b57c3b5b3d8371a5c19489f9568fc2f99c644b | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Tue Dec 20 00:02:36 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Dec 20 00:02:36 2022 +0000 |
tree | 2d4886bf255b23ca0235d30cb548c6f036f3fc1f | |
parent | 26194f8259fecfb8ae278c1b918496a3e09fd650 [diff] | |
parent | 4c8aa93e2b03485021318cd8f16a57f57faf9419 [diff] |
Upgrade which to 4.3.0 am: 93a6d69a62 am: e8978e70ba am: 4c8aa93e2b Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/2362424 Change-Id: I6cbf690e1dfc3831b9039df3b10caffd7589437a 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.