A Rust equivalent of Unix command
To find which rustc executable binary is using:
use which::which; let result = which::which("rustc").unwrap(); assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
Find a exectable binary’s path by name.
binary_namein the path list
cwdto resolve relative paths.