Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions src/currentprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::path::{Path, PathBuf};
use std::sync::Once;
use std::sync::{Arc, Mutex};

use home::env as home;
use rand::{thread_rng, Rng};

pub(crate) mod argsource;
Expand Down
2 changes: 2 additions & 0 deletions src/currentprocess/homethunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::io;
use std::ops::Deref;
use std::path::PathBuf;

use home::env as home;

use super::CurrentDirSource;
use super::HomeProcess;
use super::OSProcess;
Expand Down
7 changes: 4 additions & 3 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::io::{self, BufReader, Write};
use std::path::{Path, PathBuf};

use anyhow::{anyhow, bail, Context, Result};
use home::env as home;
use retry::delay::{jitter, Fibonacci};
use retry::{retry, OperationResult};
use sha2::Sha256;
Expand Down Expand Up @@ -493,11 +494,11 @@ pub(crate) fn to_absolute<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
}

pub(crate) fn home_dir() -> Option<PathBuf> {
home::home_dir_from(&home_process())
home::home_dir_with_env(&home_process())
}

pub(crate) fn cargo_home() -> Result<PathBuf> {
home::cargo_home_from(&home_process()).context("failed to determine cargo home")
home::cargo_home_with_env(&home_process()).context("failed to determine cargo home")
}

// Creates a ~/.rustup folder
Expand All @@ -524,7 +525,7 @@ fn rustup_home_in_user_dir() -> Result<PathBuf> {
}

pub(crate) fn rustup_home() -> Result<PathBuf> {
home::rustup_home_from(&home_process()).context("failed to determine rustup home dir")
home::rustup_home_with_env(&home_process()).context("failed to determine rustup home dir")
}

pub(crate) fn format_path_for_display(path: &str) -> String {
Expand Down