commit | 186abdd35f90214bd161c658e1a9c717b4fd25fd | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed Sep 18 20:37:09 2024 +0000 |
committer | James Farrell <[email protected]> | Wed Sep 18 20:37:09 2024 +0000 |
tree | de627b142f5175c11ec2c6d07263e2070dab5e11 | |
parent | 9826bee8e149d87e2eaea93457e3cf92f93e829e [diff] |
Migrate 26 crates to monorepo tokio-util tower tower-layer tower-service tracing tracing-attributes tracing-core tracing-subscriber try-lock tungstenite twox-hash ucd-trie unicode-bidi unicode-normalization unicode-segmentation unicode-width unsafe-libyaml userfaultfd utf-8 uuid weak-table webpki which winnow x509-cert xml-rs Bug: http://b/339424309 Test: treehugger Change-Id: I8fdf43e940689cb15eb24c881bef56e7d73831aa
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.