Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate dirs deps #320

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion russh-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "0.7.1"
rust-version = "1.65"

[dependencies]
dirs-next = "2.0"
home = "0.5"
futures = { workspace = true }
globset = "0.4.14"
log = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions russh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Config {
}

pub fn parse_home(host: &str) -> Result<Config, Error> {
let mut home = if let Some(home) = dirs_next::home_dir() {
let mut home = if let Some(home) = home::home_dir() {
home
} else {
return Err(Error::NoHome);
Expand Down Expand Up @@ -135,7 +135,7 @@ pub fn parse(file: &str, host: &str) -> Result<Config, Error> {
"identityfile" => {
let id = value.trim_start();
if id.starts_with("~/") {
if let Some(mut home) = dirs_next::home_dir() {
if let Some(mut home) = home::home_dir() {
home.push(id.split_at(2).1);
config.identity_file = Some(
home.to_str()
Expand Down
2 changes: 1 addition & 1 deletion russh-keys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ byteorder = { workspace = true }
data-encoding = "2.3"
digest = { workspace = true }
der = "0.7"
dirs = "5.0"
home = "0.5"
ecdsa = "0.16"
ed25519-dalek = { version = "2.0", features = ["rand_core", "pkcs8"] }
elliptic-curve = "0.13"
Expand Down
4 changes: 2 additions & 2 deletions russh-keys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ pub fn check_known_hosts_path<P: AsRef<Path>>(

#[cfg(target_os = "windows")]
fn known_hosts_path() -> Result<PathBuf, Error> {
if let Some(home_dir) = dirs::home_dir() {
if let Some(home_dir) = home::home_dir() {
Ok(home_dir.join("ssh").join("known_hosts"))
} else {
Err(Error::NoHomeDir)
Expand All @@ -512,7 +512,7 @@ fn known_hosts_path() -> Result<PathBuf, Error> {

#[cfg(not(target_os = "windows"))]
fn known_hosts_path() -> Result<PathBuf, Error> {
if let Some(home_dir) = dirs::home_dir() {
if let Some(home_dir) = home::home_dir() {
Ok(home_dir.join(".ssh").join("known_hosts"))
} else {
Err(Error::NoHomeDir)
Expand Down
Loading