File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ pub(crate) async fn install(
458
458
}
459
459
}
460
460
461
- let install_res: Result < utils :: ExitCode > = ( || {
461
+ let install_res = || async {
462
462
install_bins ( ) ?;
463
463
464
464
#[ cfg( unix) ]
@@ -478,12 +478,13 @@ pub(crate) async fn install(
478
478
opts. targets ,
479
479
verbose,
480
480
quiet,
481
- ) ?;
481
+ )
482
+ . await ?;
482
483
483
484
Ok ( utils:: ExitCode ( 0 ) )
484
- } ) ( ) ;
485
+ } ;
485
486
486
- if let Err ( e) = install_res {
487
+ if let Err ( e) = install_res ( ) . await {
487
488
report_error ( & e) ;
488
489
489
490
// On windows, where installation happens in a console
@@ -839,7 +840,7 @@ pub(crate) fn install_proxies() -> Result<()> {
839
840
Ok ( ( ) )
840
841
}
841
842
842
- fn maybe_install_rust (
843
+ async fn maybe_install_rust (
843
844
toolchain : Option < MaybeOfficialToolchainName > ,
844
845
profile_str : & str ,
845
846
default_host_triple : Option < & str > ,
@@ -869,16 +870,19 @@ fn maybe_install_rust(
869
870
// - delete the partial install and start over
870
871
// For now, we error.
871
872
let mut toolchain = DistributableToolchain :: new ( & cfg, desc. clone ( ) ) ?;
872
- utils:: run_future ( toolchain. update ( components, targets, cfg. get_profile ( ) ?) ) ?
873
+ toolchain
874
+ . update ( components, targets, cfg. get_profile ( ) ?)
875
+ . await ?
873
876
} else {
874
- utils :: run_future ( DistributableToolchain :: install (
877
+ DistributableToolchain :: install (
875
878
& cfg,
876
879
desc,
877
880
components,
878
881
targets,
879
882
cfg. get_profile ( ) ?,
880
883
true ,
881
- ) ) ?
884
+ )
885
+ . await ?
882
886
. 0
883
887
} ;
884
888
You can’t perform that action at this time.
0 commit comments