The home crate provides platform-specific definitions of the "home" directory as well as definitions of the
RUSTUP_HOME directory. If you need to identify cargo or rustup's installation directory, this is probably the crate you want, but note the caveats below.
This new release includes a bunch of cleanup by @lzutao (thanks!), particularly to stop building winapi crates on not-windows. So if you are using this crate, this release is probably a worthwhile update over the previous 0.3 series.
Since locating cargo and rustup's home directories is not simple (there's historical baggage), this crate was written to be the canonical definition of the two locations. As of today it appears that cargo does use this crate, but rustup instead uses the
home_dir definition from the
dirs crate plus open-coded logic for locating
CARGO_HOME. I don't recall how this situation came to be, where cargo is sharing it's home-dir logic but rustup is not, and no longer know how close the logic in this crate corresponds to rustup's actual logic (they probably used to be identical). I think rustup should be sharing its logic so that other tools can correctly identify its installation directory, and so rustup and cargo agree on
This crate is lightly maintained, and I do not know how the
home_dir function within corresponds to the
home_dir function in the officially-recommended
dirs crate. For general-purpose "home" directory logic it is probably wiser to use the