commit | 9826bee8e149d87e2eaea93457e3cf92f93e829e | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Tue Aug 06 22:10:09 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Aug 06 22:10:09 2024 +0000 |
tree | 8d47df5182800a80835bbef3d2f84abbf32eb59b | |
parent | 10e3fbf7d389ca46f7598e3488a5e49ddf7c5969 [diff] | |
parent | b49e1897622df983f493f8c80014597dda2b191b [diff] |
Update Android.bp by running cargo_embargo am: b49e189762 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/3208914 Change-Id: I0730e2b666c36766c4e4dbb69b4b745614d41254 Signed-off-by: Automerger Merge Worker <[email protected]>
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.