Closed tbu- closed 8 years ago
USERPROFILE
is Windows-only. What is the purpose of this change?
The fallback exists, it just isn't documented. See https://github.com/rust-lang/rust/pull/29690.
OK. But what is the value of the change? If HOME
is not set, the environment is not even nearly XDG compliant, I believe...
The value is that the library doesn't panic in this case, making it more useful for programs trying to be robust.
I wanted to use this library to make cargo XDG-compliant, but they probably won't like it if it generated an error in more cases due to such a change.
Hm, it's true that something like cargo shouldn't really care if the environment is perfectly XDG compliant or not.
Thanks!
std::env::home_dir
has a sensible fallback in case$HOME
is not set.