@@ -25,6 +25,7 @@ use crate::cli::rustup_mode;
25
25
use crate :: process;
26
26
use crate :: test as rustup_test;
27
27
use crate :: test:: const_dist_dir;
28
+ use crate :: test:: tempdir_in_with_prefix;
28
29
use crate :: test:: this_host_triple;
29
30
use crate :: utils;
30
31
@@ -707,19 +708,11 @@ async fn setup_test_state(test_dist_dir: tempfile::TempDir) -> (tempfile::TempDi
707
708
}
708
709
let test_dir = rustup_test:: test_dir ( ) . unwrap ( ) ;
709
710
710
- fn tempdir_in_with_prefix < P : AsRef < Path > > ( path : P , prefix : & str ) -> PathBuf {
711
- tempfile:: Builder :: new ( )
712
- . prefix ( prefix)
713
- . tempdir_in ( path. as_ref ( ) )
714
- . unwrap ( )
715
- . into_path ( )
716
- }
717
-
718
- let exedir = tempdir_in_with_prefix ( & test_dir, "rustup-exe" ) ;
719
- let customdir = tempdir_in_with_prefix ( & test_dir, "rustup-custom" ) ;
720
- let cargodir = tempdir_in_with_prefix ( & test_dir, "rustup-cargo" ) ;
721
- let homedir = tempdir_in_with_prefix ( & test_dir, "rustup-home" ) ;
722
- let workdir = tempdir_in_with_prefix ( & test_dir, "rustup-workdir" ) ;
711
+ let exedir = tempdir_in_with_prefix ( & test_dir, "rustup-exe" ) . unwrap ( ) ;
712
+ let customdir = tempdir_in_with_prefix ( & test_dir, "rustup-custom" ) . unwrap ( ) ;
713
+ let cargodir = tempdir_in_with_prefix ( & test_dir, "rustup-cargo" ) . unwrap ( ) ;
714
+ let homedir = tempdir_in_with_prefix ( & test_dir, "rustup-home" ) . unwrap ( ) ;
715
+ let workdir = tempdir_in_with_prefix ( & test_dir, "rustup-workdir" ) . unwrap ( ) ;
723
716
724
717
// The uninstall process on windows involves using the directory above
725
718
// CARGO_HOME, so make sure it's a subdir of our tempdir
0 commit comments