@@ -504,9 +504,10 @@ fn update_root(process: &Process) -> String {
504504/// `CARGO_HOME` suitable for display, possibly with $HOME
505505/// substituted for the directory prefix
506506fn canonical_cargo_home ( process : & Process ) -> Result < Cow < ' static , str > > {
507- let path = utils :: cargo_home ( process ) ?;
507+ let path = process . cargo_home ( ) ?;
508508
509- let default_cargo_home = utils:: home_dir ( process)
509+ let default_cargo_home = process
510+ . home_dir ( )
510511 . unwrap_or_else ( || PathBuf :: from ( "." ) )
511512 . join ( ".cargo" ) ;
512513 Ok ( if default_cargo_home == path {
@@ -727,7 +728,7 @@ fn check_existence_of_rustc_or_cargo_in_path(no_prompt: bool, process: &Process)
727728fn do_pre_install_sanity_checks ( no_prompt : bool , process : & Process ) -> Result < ( ) > {
728729 let rustc_manifest_path = PathBuf :: from ( "/usr/local/lib/rustlib/manifest-rustc" ) ;
729730 let uninstaller_path = PathBuf :: from ( "/usr/local/lib/rustlib/uninstall.sh" ) ;
730- let rustup_sh_path = utils :: home_dir ( process ) . unwrap ( ) . join ( ".rustup" ) ;
731+ let rustup_sh_path = process . home_dir ( ) . unwrap ( ) . join ( ".rustup" ) ;
731732 let rustup_sh_version_path = rustup_sh_path. join ( "rustup-version" ) ;
732733
733734 let rustc_exists = rustc_manifest_path. exists ( ) && uninstaller_path. exists ( ) ;
@@ -761,7 +762,7 @@ fn do_pre_install_sanity_checks(no_prompt: bool, process: &Process) -> Result<()
761762}
762763
763764fn pre_install_msg ( no_modify_path : bool , process : & Process ) -> Result < String > {
764- let cargo_home = utils :: cargo_home ( process ) ?;
765+ let cargo_home = process . cargo_home ( ) ?;
765766 let cargo_home_bin = cargo_home. join ( "bin" ) ;
766767 let rustup_home = home:: rustup_home ( ) ?;
767768
@@ -824,7 +825,7 @@ fn current_install_opts(opts: &InstallOpts<'_>, process: &Process) -> String {
824825}
825826
826827fn install_bins ( process : & Process ) -> Result < ( ) > {
827- let bin_path = utils :: cargo_home ( process ) ?. join ( "bin" ) ;
828+ let bin_path = process . cargo_home ( ) ?. join ( "bin" ) ;
828829 let this_exe_path = utils:: current_exe ( ) ?;
829830 let rustup_path = bin_path. join ( format ! ( "rustup{EXE_SUFFIX}" ) ) ;
830831
@@ -840,7 +841,7 @@ fn install_bins(process: &Process) -> Result<()> {
840841}
841842
842843pub ( crate ) fn install_proxies ( process : & Process ) -> Result < ( ) > {
843- let bin_path = utils :: cargo_home ( process ) ?. join ( "bin" ) ;
844+ let bin_path = process . cargo_home ( ) ?. join ( "bin" ) ;
844845 let rustup_path = bin_path. join ( format ! ( "rustup{EXE_SUFFIX}" ) ) ;
845846
846847 let rustup = Handle :: from_path ( & rustup_path) ?;
@@ -938,7 +939,8 @@ async fn maybe_install_rust(
938939
939940 // If RUSTUP_HOME is not set, make sure it exists
940941 if process. var_os ( "RUSTUP_HOME" ) . is_none ( ) {
941- let home = utils:: home_dir ( process)
942+ let home = process
943+ . home_dir ( )
942944 . map ( |p| p. join ( ".rustup" ) )
943945 . ok_or_else ( || anyhow:: anyhow!( "could not find home dir to put .rustup in" ) ) ?;
944946
@@ -988,7 +990,7 @@ pub(crate) fn uninstall(no_prompt: bool, process: &Process) -> Result<utils::Exi
988990 return Ok ( utils:: ExitCode ( 1 ) ) ;
989991 }
990992
991- let cargo_home = utils :: cargo_home ( process ) ?;
993+ let cargo_home = process . cargo_home ( ) ?;
992994
993995 if !cargo_home. join ( format ! ( "bin/rustup{EXE_SUFFIX}" ) ) . exists ( ) {
994996 return Err ( CLIError :: NotSelfInstalled { p : cargo_home } . into ( ) ) ;
@@ -1178,7 +1180,7 @@ fn parse_new_rustup_version(version: String) -> String {
11781180}
11791181
11801182pub ( crate ) async fn prepare_update ( process : & Process ) -> Result < Option < PathBuf > > {
1181- let cargo_home = utils :: cargo_home ( process ) ?;
1183+ let cargo_home = process . cargo_home ( ) ?;
11821184 let rustup_path = cargo_home. join ( format ! ( "bin{MAIN_SEPARATOR}rustup{EXE_SUFFIX}" ) ) ;
11831185 let setup_path = cargo_home. join ( format ! ( "bin{MAIN_SEPARATOR}rustup-init{EXE_SUFFIX}" ) ) ;
11841186
@@ -1319,7 +1321,7 @@ pub(crate) async fn check_rustup_update(process: &Process) -> Result<()> {
13191321
13201322#[ cfg_attr( feature = "otel" , tracing:: instrument) ]
13211323pub ( crate ) fn cleanup_self_updater ( process : & Process ) -> Result < ( ) > {
1322- let cargo_home = utils :: cargo_home ( process ) ?;
1324+ let cargo_home = process . cargo_home ( ) ?;
13231325 let setup = cargo_home. join ( format ! ( "bin/rustup-init{EXE_SUFFIX}" ) ) ;
13241326
13251327 if setup. exists ( ) {
0 commit comments