10 releases

0.3.4 May 11, 2024
0.3.2 Jan 21, 2024
0.2.1 Dec 27, 2023
0.2.0 Sep 14, 2023
0.1.1 Mar 31, 2023

#176 in Filesystem

Download history 431/week @ 2024-01-28 371/week @ 2024-02-04 500/week @ 2024-02-11 456/week @ 2024-02-18 435/week @ 2024-02-25 429/week @ 2024-03-03 580/week @ 2024-03-10 427/week @ 2024-03-17 494/week @ 2024-03-24 565/week @ 2024-03-31 400/week @ 2024-04-07 472/week @ 2024-04-14 715/week @ 2024-04-21 569/week @ 2024-04-28 558/week @ 2024-05-05 363/week @ 2024-05-12

2,244 downloads per month
Used in 18 crates (15 directly)

MIT license

4KB

simple-home-dir

Crate

An extremely tiny and reliable Rust library purposed to retrieve the user's home directory.

Usage

use simple_home_dir::*;

fn main() {
    // Windows => "C:\Users\<USER>"
    // Linux   => "/home/<USER>"
    // Mac     => "/Users/<USER>"
    let path = home_dir().unwrap();
    println!("{:?}", path)
}

Features

The expand_tilde feature is available here.

Testing

The dirs crate is relied upon to ensure that the functions of this crate are working properly.

Credit

The majority of the Windows portion has been noted from the windows-sys and directories crates.

Dependencies

~0–9MB
~68K SLoC