commit | 3742ab94f0761250d2e58f42e1d01f0d40b52dbf | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Wed Nov 08 17:57:55 2023 +0000 |
committer | Andrew Walbran <qwandor@google.com> | Wed Nov 08 17:57:55 2023 +0000 |
tree | aaa0209fe40c9ef15bfe9cc5f3c35d633efc312e | |
parent | 62884e502a4d24cefc135591ef2be0f50e4ed593 [diff] |
Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: I0511abc88542395e366f79d41e274ef32917f309
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.