simple-home-dir 0.5.2

Returns the path of the current user's home directory if known.
Documentation

simple-home-dir

Crate

Deprecated: This crate is no longer necessary as Rust now provides an official home_dir() method. Use std::env::home_dir() instead.

Usage

Simply use the standard library's built-in home_dir method.

pub use std::env::home_dir;

fn main() {
    // Unix     =>  /home/jdoe
    // Windows  =>  C:\Users\jdoe
    let path = home_dir().unwrap();
}