simple-home-dir

Crates.iosimple-home-dir
lib.rssimple-home-dir
version0.5.2
created_at2023-03-31 22:03:38.02533+00
updated_at2025-07-26 17:33:12.199784+00
descriptionReturns the path of the current user's home directory if known.
homepage
repositoryhttps://github.com/eschwart/simple-home-dir
max_upload_size
id826904
size2,421
Evan Schwartzentruber (eschwart)

documentation

README

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();
}
Commit count: 0

cargo fmt