@@ -898,7 +898,7 @@ fn try_update_from_dist_(
898
898
899
899
// TODO: Add a notification about which manifest version is going to be used
900
900
( download. notify_handler ) ( Notification :: DownloadingManifest ( & toolchain_str) ) ;
901
- match dl_v2_manifest (
901
+ match utils :: run_future ( dl_v2_manifest (
902
902
download,
903
903
// Even if manifest has not changed, we must continue to install requested components.
904
904
// So if components or targets is not empty, we skip passing `update_hash` so that
@@ -909,7 +909,7 @@ fn try_update_from_dist_(
909
909
None
910
910
} ,
911
911
toolchain,
912
- ) {
912
+ ) ) {
913
913
Ok ( Some ( ( m, hash) ) ) => {
914
914
( download. notify_handler ) ( Notification :: DownloadedManifest (
915
915
& m. date ,
@@ -1012,7 +1012,7 @@ fn try_update_from_dist_(
1012
1012
}
1013
1013
1014
1014
// If the v2 manifest is not found then try v1
1015
- let manifest = match dl_v1_manifest ( download, toolchain) {
1015
+ let manifest = match utils :: run_future ( dl_v1_manifest ( download, toolchain) ) {
1016
1016
Ok ( m) => m,
1017
1017
Err ( any) => {
1018
1018
enum Cases {
@@ -1068,13 +1068,16 @@ fn try_update_from_dist_(
1068
1068
}
1069
1069
}
1070
1070
1071
- pub ( crate ) fn dl_v2_manifest (
1071
+ pub ( crate ) async fn dl_v2_manifest (
1072
1072
download : DownloadCfg < ' _ > ,
1073
1073
update_hash : Option < & Path > ,
1074
1074
toolchain : & ToolchainDesc ,
1075
1075
) -> Result < Option < ( ManifestV2 , String ) > > {
1076
1076
let manifest_url = toolchain. manifest_v2_url ( download. dist_root ) ;
1077
- match utils:: run_future ( download. download_and_check ( & manifest_url, update_hash, ".toml" ) ) {
1077
+ match download
1078
+ . download_and_check ( & manifest_url, update_hash, ".toml" )
1079
+ . await
1080
+ {
1078
1081
Ok ( manifest_dl) => {
1079
1082
// Downloaded ok!
1080
1083
let ( manifest_file, manifest_hash) = if let Some ( m) = manifest_dl {
@@ -1097,7 +1100,10 @@ pub(crate) fn dl_v2_manifest(
1097
1100
}
1098
1101
}
1099
1102
1100
- fn dl_v1_manifest ( download : DownloadCfg < ' _ > , toolchain : & ToolchainDesc ) -> Result < Vec < String > > {
1103
+ async fn dl_v1_manifest (
1104
+ download : DownloadCfg < ' _ > ,
1105
+ toolchain : & ToolchainDesc ,
1106
+ ) -> Result < Vec < String > > {
1101
1107
let root_url = toolchain. package_dir ( download. dist_root ) ;
1102
1108
1103
1109
if ![ "nightly" , "beta" , "stable" ] . contains ( & & * toolchain. channel ) {
@@ -1111,7 +1117,7 @@ fn dl_v1_manifest(download: DownloadCfg<'_>, toolchain: &ToolchainDesc) -> Resul
1111
1117
}
1112
1118
1113
1119
let manifest_url = toolchain. manifest_v1_url ( download. dist_root ) ;
1114
- let manifest_dl = utils :: run_future ( download. download_and_check ( & manifest_url, None , "" ) ) ?;
1120
+ let manifest_dl = download. download_and_check ( & manifest_url, None , "" ) . await ?;
1115
1121
let ( manifest_file, _) = manifest_dl. unwrap ( ) ;
1116
1122
let manifest_str = utils:: read_file ( "manifest" , & manifest_file) ?;
1117
1123
let urls = manifest_str
0 commit comments