commit | 35234329bdbdedb035c08d505d37decb3446e99c | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 18 10:09:49 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 18 10:09:49 2022 +0000 |
tree | 0ee35a94c440d4b17b59f4adbc625f2cee3fb7f3 | |
parent | 0ed0506f8e0e09a5fc9203ba26aede2228d96b6f [diff] | |
parent | 8f9f3a26fd005d3bc580ee99055f9492ca0ed03f [diff] |
Snap for 8319971 from 8f9f3a26fd005d3bc580ee99055f9492ca0ed03f to t-keystone-qcom-release Change-Id: I87fb6183227e092646d901b883f16d823d5fc4ec
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.