commit | 4e57a3a15685909488544099d60f532eb62e0914 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Mar 10 02:23:07 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Mar 10 02:23:07 2023 +0000 |
tree | bb7fed649d07e5b24e581d19ccf3c547b2b86c62 | |
parent | 8fdc5eeb2d598a28211499b2f5055cf6376de9b2 [diff] | |
parent | 62884e502a4d24cefc135591ef2be0f50e4ed593 [diff] |
Snap for 9719949 from 62884e502a4d24cefc135591ef2be0f50e4ed593 to udc-release Change-Id: Ie92494a996621633f4b3d64314f54d403561bd37
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.