@@ -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:: { Components , DirectoryPackage , Transaction } ;
1716use crate :: dist:: config:: Config ;
@@ -151,8 +150,6 @@ impl Manifestation {
151150 }
152151 }
153152
154- let altered = tmp_cx. dist_server != DEFAULT_DIST_SERVER ;
155-
156153 // Download component packages and validate hashes
157154 let mut things_to_install = Vec :: new ( ) ;
158155 let mut things_downloaded = Vec :: new ( ) ;
@@ -188,17 +185,7 @@ impl Manifestation {
188185 let sem = semaphore. clone ( ) ;
189186 async move {
190187 let _permit = sem. acquire ( ) . await . unwrap ( ) ;
191- let url = if altered {
192- utils:: parse_url (
193- & bin. binary
194- . url
195- . replace ( DEFAULT_DIST_SERVER , tmp_cx. dist_server . as_str ( ) ) ,
196- ) ?
197- } else {
198- utils:: parse_url ( & bin. binary . url ) ?
199- } ;
200-
201- bin. download ( & url, download_cfg, max_retries, new_manifest)
188+ bin. download ( download_cfg, max_retries, new_manifest)
202189 . await
203190 . map ( |downloaded| ( bin, downloaded) )
204191 }
@@ -697,16 +684,16 @@ struct ComponentBinary<'a> {
697684impl < ' a > ComponentBinary < ' a > {
698685 async fn download (
699686 & self ,
700- url : & Url ,
701687 download_cfg : & DownloadCfg < ' _ > ,
702688 max_retries : usize ,
703689 new_manifest : & Manifest ,
704690 ) -> Result < File > {
705691 use tokio_retry:: { RetryIf , strategy:: FixedInterval } ;
706692
693+ let url = download_cfg. url ( & self . binary . url ) ?;
707694 let downloaded_file = RetryIf :: spawn (
708695 FixedInterval :: from_millis ( 0 ) . take ( max_retries) ,
709- || download_cfg. download ( url, & self . binary . hash , & self . status ) ,
696+ || download_cfg. download ( & url, & self . binary . hash , & self . status ) ,
710697 |e : & anyhow:: Error | {
711698 // retry only known retriable cases
712699 match e. downcast_ref :: < RustupError > ( ) {
0 commit comments