mirror of
https://github.com/openharmony/third_party_rust_which-rs.git
synced 2026-07-01 21:14:07 -04:00
7df710e9f670dd1bc97c6ce355d9cd2efb154f81
For performance, it is desirable to accept &Regex instead of Regex. By changing changing to impl Borrow<Regex>, all existing code remains valid, but &Regex is also accepted.
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.
Description
提供查找可执行文件或库的路径的支持,可以在程序中查找指定可执行文件或库的路径。 | A Rust library that provides support for finding the path to an executable in the system's PATH.
Languages
Rust
100%