mirror of
https://gitee.com/openharmony/third_party_rust_which-rs
synced 2024-11-23 07:29:42 +00:00
7ea0c5e80a
The import was necessary when using the regex feature. |
||
---|---|---|
.github/workflows | ||
src | ||
tests | ||
.gitignore | ||
Cargo.toml | ||
LICENSE.txt | ||
README.md |
which
A Rust equivalent of Unix command "which". Locate installed executable in cross platforms.
Support platforms
- Linux
- Windows
- macOS
Example
To find which rustc exectable binary is using.
use which::which;
let result = which::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
Documentation
The documentation is available online.