Skip to content

Commit 36cb494

Browse files
micolousXaeroxe
authored andcommitted
Switch to env_home crate. Fixes #104
1 parent 1b5f7be commit 36cb494

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ regex = { version = "1.10.2", optional = true }
2222
tracing = { version = "0.1.40", default-features = false, optional = true }
2323

2424
[target.'cfg(any(windows, unix, target_os = "redox"))'.dependencies]
25-
home = "0.5.9"
25+
env_home = "0.1.0"
2626

2727
[target.'cfg(any(unix, target_os = "wasi", target_os = "redox"))'.dependencies]
2828
rustix = { version = "0.38.30", default-features = false, features = ["fs", "std"] }

src/finder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ use std::fs;
1515
use std::iter;
1616
use std::path::{Component, Path, PathBuf};
1717

18-
// Home dir shim, use home crate when possible. Otherwise, return None
18+
// Home dir shim, use env_home crate when possible. Otherwise, return None
1919
#[cfg(any(windows, unix, target_os = "redox"))]
20-
use home::home_dir;
20+
use env_home::env_home_dir;
2121

2222
#[cfg(not(any(windows, unix, target_os = "redox")))]
23-
fn home_dir() -> Option<std::path::PathBuf> {
23+
fn env_home_dir() -> Option<std::path::PathBuf> {
2424
None
2525
}
2626

@@ -266,7 +266,7 @@ fn tilde_expansion(p: &PathBuf) -> Cow<'_, PathBuf> {
266266
let mut component_iter = p.components();
267267
if let Some(Component::Normal(o)) = component_iter.next() {
268268
if o == "~" {
269-
let mut new_path = home_dir().unwrap_or_default();
269+
let mut new_path = env_home_dir().unwrap_or_default();
270270
new_path.extend(component_iter);
271271
#[cfg(feature = "tracing")]
272272
tracing::trace!(

0 commit comments

Comments
 (0)