commit | d9d261bae52be7088afe27750e9ed4c609093eb0 | [log] [tgz] |
---|---|---|
author | David LeGare <[email protected]> | Mon Apr 18 17:10:12 2022 +0000 |
committer | David LeGare <[email protected]> | Mon Apr 18 17:38:15 2022 +0000 |
tree | 74b760abd18f993e3501cabf9342ccb8d6b484f5 | |
parent | d4a8e3fb8db3b7dac259563a6215de9942b40721 [diff] |
Upgrade rust/crates/which to 4.2.5 Test: make Change-Id: I700a46e4b09b039d4c58f0ac1d14b059cd7b1bd8
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.