commit | 37e1af73693d14ea015e0f8f7e2a3454ac0e68ed | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Nov 10 02:14:43 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Nov 10 02:14:43 2023 +0000 |
tree | aaa0209fe40c9ef15bfe9cc5f3c35d633efc312e | |
parent | 88d1f839cdefaf2cba80e9bb2ea31b416749a59d [diff] | |
parent | 35bb38904b9c11ac40b025bc7fe2fe478cedb3d7 [diff] |
Snap for 11079393 from 35bb38904b9c11ac40b025bc7fe2fe478cedb3d7 to 24D1-release Change-Id: Iba2f6161c4a5c8d5705c39ba5ab7a5189c86496f
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.