commit | 3eef3d34b390fed0c0a952c0374f4002702615d5 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:44:33 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:44:33 2024 +0000 |
tree | e10a059624825fba343f2bc699bd9edd7e8c759a | |
parent | bbaf038e34d13a26b0dca38260985282165723d7 [diff] | |
parent | 6560ec8245bde1c4de112b4f2d7d3b08ab0afa1f [diff] |
Snap for 11880863 from 6560ec8245bde1c4de112b4f2d7d3b08ab0afa1f to build-tools-release Change-Id: I0089394bd95d6c9139e823dd4a4421d2923c0d13
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.