Skip to content

Commit 0ed61c6

Browse files
committed
dist: avoid passing through arguments
1 parent 723e9e2 commit 0ed61c6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/dist/manifestation.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ impl Manifestation {
189189
async move {
190190
let _permit = sem.acquire().await.unwrap();
191191
self.download_component(
192-
component,
193-
format,
194-
url,
195-
hash,
192+
&component,
193+
&url,
194+
&hash,
196195
altered,
197196
tmp_cx,
198197
download_cfg,
199198
max_retries,
200199
new_manifest,
201200
)
202201
.await
202+
.map(|downloaded| (component, format, downloaded, hash))
203203
}
204204
});
205205
if components_len > 0 {
@@ -535,22 +535,21 @@ impl Manifestation {
535535
#[allow(clippy::too_many_arguments)]
536536
async fn download_component(
537537
&self,
538-
component: Component,
539-
format: CompressionKind,
540-
url: String,
541-
hash: String,
538+
component: &Component,
539+
url: &str,
540+
hash: &str,
542541
altered: bool,
543542
tmp_cx: &temp::Context,
544543
download_cfg: &DownloadCfg<'_>,
545544
max_retries: usize,
546545
new_manifest: &Manifest,
547-
) -> Result<(Component, CompressionKind, File, String)> {
546+
) -> Result<File> {
548547
use tokio_retry::{RetryIf, strategy::FixedInterval};
549548

550549
let url = if altered {
551550
url.replace(DEFAULT_DIST_SERVER, tmp_cx.dist_server.as_str())
552551
} else {
553-
url
552+
url.to_owned()
554553
};
555554

556555
let url_url = utils::parse_url(&url)?;
@@ -573,7 +572,7 @@ impl Manifestation {
573572
.await
574573
.with_context(|| RustupError::ComponentDownloadFailed(component.name(new_manifest)))?;
575574

576-
Ok((component, format, downloaded_file, hash))
575+
Ok(downloaded_file)
577576
}
578577
}
579578

0 commit comments

Comments
 (0)