13 releases

0.5.9 Dec 15, 2023
0.5.5 Apr 25, 2023
0.5.4 Oct 11, 2022
0.5.3 Jan 7, 2020
0.3.0 Jul 19, 2017

#21 in Operating systems

Download history 1056300/week @ 2024-07-17 1092479/week @ 2024-07-24 1131952/week @ 2024-07-31 1142246/week @ 2024-08-07 1151717/week @ 2024-08-14 1187335/week @ 2024-08-21 1150170/week @ 2024-08-28 1252495/week @ 2024-09-04 1206409/week @ 2024-09-11 1332084/week @ 2024-09-18 1425446/week @ 2024-09-25 1768441/week @ 2024-10-02 1833454/week @ 2024-10-09 1859753/week @ 2024-10-16 1404824/week @ 2024-10-23 1329518/week @ 2024-10-30

6,778,793 downloads per month
Used in 5,482 crates (617 directly)

MIT/Apache

15KB
152 lines

Documentation crates.io

Canonical definitions of home_dir, cargo_home, and rustup_home.

This provides the definition of home_dir used by Cargo and rustup, as well functions to find the correct value of CARGO_HOME and RUSTUP_HOME.

The definition of home_dir provided by the standard library is incorrect because it considers the HOME environment variable on Windows. This causes surprising situations where a Rust program will behave differently depending on whether it is run under a Unix emulation environment like Cygwin or MinGW. Neither Cargo nor rustup use the standard library's definition - they use the definition here.

This crate further provides two functions, cargo_home and rustup_home, which are the canonical way to determine the location that Cargo and rustup store their data.

See rust-lang/rust#43321.

License

MIT OR Apache-2.0

Dependencies

~0–7.5MB
~56K SLoC