Function home::rustup_home[][src]

pub fn rustup_home() -> Result<PathBuf>

Returns the storage directory used by rustup, often knowns as .rustup or RUSTUP_HOME.

It returns one of the following values, in this order of preference:

Errors

This function fails if it fails to retrieve the current directory, or if the home directory cannot be determined.

Examples

match home::rustup_home() {
    Ok(path) => println!("{}", path.display()),
    Err(err) => eprintln!("Cannot get your rustup home dir: {:?}", err),
}