Skip to content

Commit

Permalink
Drop the home dependency.
Browse files Browse the repository at this point in the history
Fixes #62.
  • Loading branch information
whitequark committed Jul 23, 2023
1 parent a847ccc commit 1102d64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Expand Up @@ -16,5 +16,4 @@ authors = [
]

[dependencies]
home = "0.5"
serde = { version = "1.0", features = ["derive"], optional = true }
7 changes: 5 additions & 2 deletions src/base_directories.rs
Expand Up @@ -194,7 +194,7 @@ impl BaseDirectories {
/// and returns a value that can be used for lookup.
/// The following environment variables are examined:
///
/// * `HOME`; if not set: use the same fallback as `home::home_dir()`;
/// * `HOME`; if not set: use the same fallback as `std::env::home_dir()`;
/// if still not available: return an error.
/// * `XDG_DATA_HOME`; if not set: assumed to be `$HOME/.local/share`.
/// * `XDG_CONFIG_HOME`; if not set: assumed to be `$HOME/.config`.
Expand Down Expand Up @@ -286,7 +286,10 @@ impl BaseDirectories {
}
}

let home = home::home_dir().ok_or(Error::new(HomeMissing))?;
// This crate only supports Unix, and the behavior of `std::env::home_dir()` is only
// problematic on Windows.
#[allow(deprecated)]
let home = std::env::home_dir().ok_or(Error::new(HomeMissing))?;

let data_home = env_var("XDG_DATA_HOME")
.and_then(abspath)
Expand Down

0 comments on commit 1102d64

Please sign in to comment.