@@ -11,7 +11,6 @@ use futures_util::stream::StreamExt;
1111use std:: sync:: Arc ;
1212use tokio:: sync:: Semaphore ;
1313use tracing:: { info, warn} ;
14- use url:: Url ;
1514
1615use crate :: dist:: component:: {
1716 Components , Package , TarGzPackage , TarXzPackage , TarZStdPackage , Transaction ,
@@ -153,8 +152,6 @@ impl Manifestation {
153152 }
154153 }
155154
156- let altered = tmp_cx. dist_server != DEFAULT_DIST_SERVER ;
157-
158155 // Download component packages and validate hashes
159156 let mut things_to_install = Vec :: new ( ) ;
160157 let mut things_downloaded = Vec :: new ( ) ;
@@ -190,17 +187,7 @@ impl Manifestation {
190187 let sem = semaphore. clone ( ) ;
191188 async move {
192189 let _permit = sem. acquire ( ) . await . unwrap ( ) ;
193- let url = if altered {
194- utils:: parse_url (
195- & bin. binary
196- . url
197- . replace ( DEFAULT_DIST_SERVER , tmp_cx. dist_server . as_str ( ) ) ,
198- ) ?
199- } else {
200- utils:: parse_url ( & bin. binary . url ) ?
201- } ;
202-
203- bin. download ( & url, download_cfg, max_retries, new_manifest)
190+ bin. download ( download_cfg, max_retries, new_manifest)
204191 . await
205192 . map ( |downloaded| ( bin, downloaded) )
206193 }
@@ -699,16 +686,16 @@ struct ComponentBinary<'a> {
699686impl < ' a > ComponentBinary < ' a > {
700687 async fn download (
701688 & self ,
702- url : & Url ,
703689 download_cfg : & DownloadCfg < ' _ > ,
704690 max_retries : usize ,
705691 new_manifest : & Manifest ,
706692 ) -> Result < File > {
707693 use tokio_retry:: { RetryIf , strategy:: FixedInterval } ;
708694
695+ let url = download_cfg. url ( & self . binary . url ) ?;
709696 let downloaded_file = RetryIf :: spawn (
710697 FixedInterval :: from_millis ( 0 ) . take ( max_retries) ,
711- || download_cfg. download ( url, & self . binary . hash , & self . status ) ,
698+ || download_cfg. download ( & url, & self . binary . hash , & self . status ) ,
712699 |e : & anyhow:: Error | {
713700 // retry only known retriable cases
714701 match e. downcast_ref :: < RustupError > ( ) {
0 commit comments