commit | 1ddecc04f22252df9431df4a95c210e8d8ab59c6 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Aug 08 01:15:24 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Aug 08 01:15:24 2024 +0000 |
tree | 8d47df5182800a80835bbef3d2f84abbf32eb59b | |
parent | 10e3fbf7d389ca46f7598e3488a5e49ddf7c5969 [diff] | |
parent | 2b4e29ff937081f2fcf0c8f85582c91b34649fa7 [diff] |
Snap for 12199973 from 2b4e29ff937081f2fcf0c8f85582c91b34649fa7 to 24Q4-release Change-Id: I50bc6a7c2248f1628f04621790000fdf28394a73
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.