Skip to content

Commit 97d2100

Browse files
committed
dist: inline trivial wrapper function
1 parent 189885a commit 97d2100

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

src/cli/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ pub(crate) async fn update_all_channels(
219219
let mut toolchains = Vec::new();
220220
for (desc, mut distributable) in cfg.list_channels()? {
221221
let result = distributable
222-
.update_extra(&[], &[], profile, force_update, false)
222+
.update(&[], &[], profile, force_update, false)
223223
.await;
224224

225225
if let Err(e) = &result {

src/cli/rustup_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,8 @@ async fn update(
966966
let profile = cfg.get_profile()?;
967967
let status = match DistributableToolchain::new(cfg, desc.clone()) {
968968
Ok(mut d) => {
969-
d.update_extra(&components, &targets, profile, force, allow_downgrade)
969+
let profile = cfg.get_profile()?;
970+
d.update(&components, &targets, profile, force, allow_downgrade)
970971
.await?
971972
}
972973
Err(RustupError::ToolchainNotInstalled { .. }) => {

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ async fn maybe_install_rust(opts: InstallOpts<'_>, cfg: &mut Cfg<'_>) -> Result<
10051005
// For now, we error.
10061006
let mut toolchain = DistributableToolchain::new(cfg, desc.clone())?;
10071007
toolchain
1008-
.update(components, targets, cfg.get_profile()?)
1008+
.update(components, targets, cfg.get_profile()?, true, false)
10091009
.await?
10101010
} else {
10111011
DistributableToolchain::install(

src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,9 @@ impl<'a> Cfg<'a> {
808808
info!("using existing install for {toolchain}");
809809
}
810810
let status = if !distributable.components_exist(&components, &targets)? {
811-
distributable.update(&components, &targets, profile).await?
811+
distributable
812+
.update(&components, &targets, profile, true, false)
813+
.await?
812814
} else {
813815
UpdateStatus::Unchanged
814816
};

src/toolchain/distributable.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -350,20 +350,9 @@ impl<'a> DistributableToolchain<'a> {
350350
InstallPrefix::from(self.toolchain.path().to_owned()).guess_v1_manifest()
351351
}
352352

353-
#[tracing::instrument(level = "trace", err(level = "trace"), skip_all)]
354-
pub(crate) async fn update(
355-
&mut self,
356-
components: &[&str],
357-
targets: &[&str],
358-
profile: Profile,
359-
) -> anyhow::Result<UpdateStatus> {
360-
self.update_extra(components, targets, profile, true, false)
361-
.await
362-
}
363-
364353
/// Update a toolchain with control over the channel behaviour
365354
#[tracing::instrument(level = "trace", err(level = "trace"), skip_all)]
366-
pub(crate) async fn update_extra(
355+
pub(crate) async fn update(
367356
&mut self,
368357
components: &[&str],
369358
targets: &[&str],

0 commit comments

Comments
 (0)