Skip to content

Commit 9694b4b

Browse files
rbtcollinsdjc
authored andcommitted
Make toolchain.update async
1 parent dca11ff commit 9694b4b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ fn maybe_install_rust(
869869
// - delete the partial install and start over
870870
// For now, we error.
871871
let mut toolchain = DistributableToolchain::new(&cfg, desc.clone())?;
872-
toolchain.update(components, targets, cfg.get_profile()?)?
872+
utils::run_future(toolchain.update(components, targets, cfg.get_profile()?))?
873873
} else {
874874
DistributableToolchain::install(
875875
&cfg,

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,11 @@ impl Cfg {
798798
}
799799
Ok(mut distributable) => {
800800
if !distributable.components_exist(&components, &targets)? {
801-
distributable.update(
801+
utils::run_future(distributable.update(
802802
&components,
803803
&targets,
804804
profile.unwrap_or(Profile::Default),
805-
)?;
805+
))?;
806806
}
807807
distributable
808808
}

src/toolchain/distributable.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,14 @@ impl<'a> DistributableToolchain<'a> {
372372
}
373373

374374
#[cfg_attr(feature = "otel", tracing::instrument(err, skip_all))]
375-
pub(crate) fn update(
375+
pub(crate) async fn update(
376376
&mut self,
377377
components: &[&str],
378378
targets: &[&str],
379379
profile: Profile,
380380
) -> anyhow::Result<UpdateStatus> {
381-
utils::run_future(self.update_extra(components, targets, profile, true, false))
381+
self.update_extra(components, targets, profile, true, false)
382+
.await
382383
}
383384

384385
/// Update a toolchain with control over the channel behaviour

0 commit comments

Comments
 (0)