11 releases

0.3.5 Jun 17, 2024
0.3.3 Apr 21, 2024
0.3.2 Jan 21, 2024
0.2.1 Dec 27, 2023
0.1.1 Mar 31, 2023

#157 in Filesystem

Download history 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 603/week @ 2024-05-09 448/week @ 2024-05-16 604/week @ 2024-05-23 630/week @ 2024-05-30 1409/week @ 2024-06-06 1607/week @ 2024-06-13 1635/week @ 2024-06-20 1187/week @ 2024-06-27

5,928 downloads per month
Used in 19 crates (16 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