Skip to content

Commit 0e444e3

Browse files
rbtcollinsdjc
authored andcommitted
Make override_add async
1 parent 3d51ca4 commit 0e444e3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/cli/rustup_mode.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub async fn main() -> Result<utils::ExitCode> {
658658
RustupSubcmd::Override { subcmd } => match subcmd {
659659
OverrideSubcmd::List => handle_epipe(common::list_overrides(cfg)),
660660
OverrideSubcmd::Set { toolchain, path } => {
661-
override_add(cfg, toolchain, path.as_deref())
661+
override_add(cfg, toolchain, path.as_deref()).await
662662
}
663663
OverrideSubcmd::Unset { path, nonexistent } => {
664664
override_remove(cfg, path.as_deref(), nonexistent)
@@ -1281,7 +1281,7 @@ fn toolchain_remove(cfg: &mut Cfg, opts: UninstallOpts) -> Result<utils::ExitCod
12811281
Ok(utils::ExitCode(0))
12821282
}
12831283

1284-
fn override_add(
1284+
async fn override_add(
12851285
cfg: &Cfg,
12861286
toolchain: ResolvableToolchainName,
12871287
path: Option<&Path>,
@@ -1299,15 +1299,10 @@ fn override_add(
12991299
Err(e @ RustupError::ToolchainNotInstalled(_)) => match &toolchain_name {
13001300
ToolchainName::Custom(_) => Err(e)?,
13011301
ToolchainName::Official(desc) => {
1302-
let status = utils::run_future(DistributableToolchain::install(
1303-
cfg,
1304-
desc,
1305-
&[],
1306-
&[],
1307-
cfg.get_profile()?,
1308-
false,
1309-
))?
1310-
.0;
1302+
let status =
1303+
DistributableToolchain::install(cfg, desc, &[], &[], cfg.get_profile()?, false)
1304+
.await?
1305+
.0;
13111306
writeln!(process().stdout().lock())?;
13121307
common::show_channel_update(
13131308
cfg,

0 commit comments

Comments
 (0)