Skip to content

Commit 1b7e263

Browse files
committed
Update home usage to new env fn
1 parent 8f6b536 commit 1b7e263

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/currentprocess.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ use varsource::*;
5555
/// The real trait is CurrentProcess; HomeProcess is a single trait because
5656
/// Box<T> only allows autotraits to be added to it; so we use a subtrait to add
5757
/// home::Env in.
58-
pub trait HomeProcess: CurrentProcess + home::Env {
58+
pub trait HomeProcess: CurrentProcess + home::env::Env {
5959
fn clone_boxed(&self) -> Box<dyn HomeProcess>;
6060
}
6161

6262
// Machinery for Cloning boxes
6363

6464
impl<T> HomeProcess for T
6565
where
66-
T: 'static + CurrentProcess + home::Env + Clone,
66+
T: 'static + CurrentProcess + home::env::Env + Clone,
6767
{
6868
fn clone_boxed(&self) -> Box<dyn HomeProcess + 'static> {
6969
Box::new(T::clone(self))

src/currentprocess/homethunk.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ use super::OSProcess;
1010
use super::TestProcess;
1111
use super::VarSource;
1212

13-
impl home::Env for Box<dyn HomeProcess + 'static> {
13+
impl home::env::Env for Box<dyn HomeProcess + 'static> {
1414
fn home_dir(&self) -> Option<PathBuf> {
1515
(**self).home_dir()
1616
}
1717
fn current_dir(&self) -> Result<PathBuf, io::Error> {
18-
home::Env::current_dir(&(**self))
18+
home::env::Env::current_dir(&(**self))
1919
}
2020
fn var_os(&self, key: &str) -> Option<OsString> {
21-
home::Env::var_os(&(**self), key)
21+
home::env::Env::var_os(&(**self), key)
2222
}
2323
}
2424

25-
impl home::Env for TestProcess {
25+
impl home::env::Env for TestProcess {
2626
fn home_dir(&self) -> Option<PathBuf> {
2727
self.var("HOME").ok().map(|v| v.into())
2828
}
@@ -34,14 +34,14 @@ impl home::Env for TestProcess {
3434
}
3535
}
3636

37-
impl home::Env for OSProcess {
37+
impl home::env::Env for OSProcess {
3838
fn home_dir(&self) -> Option<PathBuf> {
39-
home::OS_ENV.home_dir()
39+
home::env::OS_ENV.home_dir()
4040
}
4141
fn current_dir(&self) -> Result<PathBuf, io::Error> {
42-
home::OS_ENV.current_dir()
42+
home::env::OS_ENV.current_dir()
4343
}
4444
fn var_os(&self, key: &str) -> Option<OsString> {
45-
home::OS_ENV.var_os(key)
45+
home::env::OS_ENV.var_os(key)
4646
}
4747
}

src/utils/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,11 @@ pub(crate) fn to_absolute<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
493493
}
494494

495495
pub(crate) fn home_dir() -> Option<PathBuf> {
496-
home::home_dir_from(&home_process())
496+
home::env::home_dir_with_env(&home_process())
497497
}
498498

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

503503
// Creates a ~/.rustup folder
@@ -524,7 +524,7 @@ fn rustup_home_in_user_dir() -> Result<PathBuf> {
524524
}
525525

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

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

0 commit comments

Comments
 (0)