Skip to content

Commit 5baddf8

Browse files
rbtcollinsdjc
authored andcommitted
Make default_ async
1 parent fa18eb6 commit 5baddf8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/cli/rustup_mode.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ pub async fn main() -> Result<utils::ExitCode> {
632632
ToolchainSubcmd::Uninstall { opts } => toolchain_remove(cfg, opts),
633633
},
634634
RustupSubcmd::Check => check_updates(cfg).await,
635-
RustupSubcmd::Default { toolchain } => default_(cfg, toolchain),
635+
RustupSubcmd::Default { toolchain } => default_(cfg, toolchain).await,
636636
RustupSubcmd::Target { subcmd } => match subcmd {
637637
TargetSubcmd::List {
638638
toolchain,
@@ -702,7 +702,10 @@ pub async fn main() -> Result<utils::ExitCode> {
702702
}
703703
}
704704

705-
fn default_(cfg: &Cfg, toolchain: Option<MaybeResolvableToolchainName>) -> Result<utils::ExitCode> {
705+
async fn default_(
706+
cfg: &Cfg,
707+
toolchain: Option<MaybeResolvableToolchainName>,
708+
) -> Result<utils::ExitCode> {
706709
common::warn_if_host_is_emulated();
707710

708711
if let Some(toolchain) = toolchain {
@@ -716,9 +719,7 @@ fn default_(cfg: &Cfg, toolchain: Option<MaybeResolvableToolchainName>) -> Resul
716719
}
717720
MaybeResolvableToolchainName::Some(ResolvableToolchainName::Official(toolchain)) => {
718721
let desc = toolchain.resolve(&cfg.get_default_host_triple()?)?;
719-
let status = utils::run_future(DistributableToolchain::install_if_not_installed(
720-
cfg, &desc,
721-
))?;
722+
let status = DistributableToolchain::install_if_not_installed(cfg, &desc).await?;
722723

723724
cfg.set_default(Some(&(&desc).into()))?;
724725

0 commit comments

Comments
 (0)