commit | a4819d77f638da2f7602c16c4c272601adbbc249 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Sep 21 01:16:51 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Sep 21 01:16:51 2024 +0000 |
tree | de627b142f5175c11ec2c6d07263e2070dab5e11 | |
parent | 1ddecc04f22252df9431df4a95c210e8d8ab59c6 [diff] | |
parent | 80ae887cdbcd07315d133af0f1556a5de4a4dffe [diff] |
Snap for 12397640 from 80ae887cdbcd07315d133af0f1556a5de4a4dffe to 24Q4-release Change-Id: I19f7c9a1758865cfc68a1d897948700e4759c5a1
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.