commit | 8fdc5eeb2d598a28211499b2f5055cf6376de9b2 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Feb 18 06:25:30 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Feb 18 06:25:30 2023 +0000 |
tree | 8d776c48ca763a8a92725842792c44c68bd6d5b0 | |
parent | dfe1209eb7368caa8fbd5a5356684f28f2886a04 [diff] | |
parent | bcfaaa4c96f1ceb112b118a9b89a06b6d7597305 [diff] |
Snap for 9626528 from bcfaaa4c96f1ceb112b118a9b89a06b6d7597305 to udc-release Change-Id: I9079ceb4363dc5d3dca314688adc2e98e6b86094
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.