pub fn find(exec: &str) -> Option<Utf8PathBuf>Expand description
find return a PathBuf for the given executable, it tries to find it in PATH and environment variables.
The current implementation checks three places for an executable to use:
- $PATH/
<executable_name>example: for cargo, this tries all paths in $PATH with appendedcargo, returning the first that exists - Appropriate environment variable (erroring if this is set but not a usable executable) example: for cargo, this checks $CARGO environment variable; for rustc, $RUSTC; etc