10 releases

new 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

#175 in Filesystem

Download history 387/week @ 2024-01-25 426/week @ 2024-02-01 388/week @ 2024-02-08 558/week @ 2024-02-15 398/week @ 2024-02-22 445/week @ 2024-02-29 444/week @ 2024-03-07 580/week @ 2024-03-14 471/week @ 2024-03-21 563/week @ 2024-03-28 401/week @ 2024-04-04 458/week @ 2024-04-11 688/week @ 2024-04-18 552/week @ 2024-04-25 476/week @ 2024-05-02 502/week @ 2024-05-09

2,305 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
~65K SLoC