Skip to main content

resolve_executable

Function resolve_executable 

Source
pub fn resolve_executable(path: PathBuf) -> Option<PathBuf>
Expand description

Resolves an owned path to the actual on-disk executable file, if any.

On Unix this is a straight passthrough: if the path is executable, the path is returned unchanged (no clone). This keeps pathsearch::next allocation-free on the happy path.

On Windows this function may append a PATHEXT extension and return a possibly-different PathBuf.