commit | 5f34e45722cbb12fc5870996df7be4175e4cff48 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Mon Jul 03 15:56:53 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Mon Jul 03 15:56:53 2023 +0000 |
tree | bb7fed649d07e5b24e581d19ccf3c547b2b86c62 | |
parent | 07814e9a3f6ab80654eb566fe6c2d8960cd48040 [diff] | |
parent | 878f532dd57bdcbce44364b7eecb1811140e99b7 [diff] |
Snap for 10428683 from 878f532dd57bdcbce44364b7eecb1811140e99b7 to mainline-adbd-release Change-Id: I0a46df664dc0d4e84b1ff6f95b77186158ab6a3c
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.