whitequark / rust-xdg

A library that makes it easy to follow the X Desktop Group specifications
https://wiki.freedesktop.org/www/Specifications/
Apache License 2.0
146 stars 29 forks source link

Drop the `home` dependency? #62

Closed nickelc closed 11 months ago

nickelc commented 1 year ago

This crate supports the Base Directory spec only for unix & redox and not windows. And the home crate basically boils down to calling std::env::home_dir() for the supported targets.

home source

#[cfg(any(unix, target_os = "redox"))]
fn home_dir_inner() -> Option<PathBuf> {
    #[allow(deprecated)]
    std::env::home_dir()
}

Would it not make sense to just drop it and switch back to std::env::home_dir() when the function is only deprecated because the function's behavior may be unexpected on Windows?

whitequark commented 1 year ago

I think it makes more sense to return %USERPROFILE% or the result of GetUserProfileDirectory and skip %HOME% on Windows.

utkarshgupta137 commented 1 year ago

Yeah, if Windows support is not planned, then might as well remove the home dep.