A Rust equivalent of Unix command "which". Locate installed executable in cross platforms.
1) To find which rustc executable binary is using.
``` rust
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:
``` rust use which::which_re;
whichre(Regex::new("^cargo-.*").unwrap()).unwrap() .foreach(|pth| println!("{}", pth.tostringlossy())); ```
The documentation is available online.