tag | e2eeab59a39d3248682dd8ed2b57248334183ab0 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Tue Mar 12 15:42:49 2024 -0700 |
object | 3c6c54b8c6ac320843ccf9be90dad382d26ce497 |
aml_cbr_341410010
commit | 3c6c54b8c6ac320843ccf9be90dad382d26ce497 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 01:05:08 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 01:05:08 2023 +0000 |
tree | bb7fed649d07e5b24e581d19ccf3c547b2b86c62 | |
parent | 8a78a89aec0a081ab19214cd73dd723e2f393910 [diff] | |
parent | 878f532dd57bdcbce44364b7eecb1811140e99b7 [diff] |
Snap for 10447354 from 878f532dd57bdcbce44364b7eecb1811140e99b7 to mainline-cellbroadcast-release Change-Id: I219c704a23f2400a13ad943c8c5a0a9dd3a9f514
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.