Skip to content

Commit 4c2bbb6

Browse files
committed
Rename desc fields to toolchain
1 parent f55fba1 commit 4c2bbb6

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

src/dist/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ impl fmt::Display for Profile {
713713
#[derive(Clone)]
714714
pub(crate) struct DistOptions<'a> {
715715
pub(crate) cfg: &'a Cfg<'a>,
716-
pub(crate) desc: &'a ToolchainDesc,
716+
pub(crate) toolchain: &'a ToolchainDesc,
717717
pub(crate) profile: Profile,
718718
pub(crate) update_hash: Option<&'a Path>,
719719
pub(crate) dl_cfg: DownloadCfg<'a>,
@@ -752,9 +752,9 @@ pub(crate) async fn update_from_dist(
752752

753753
let mut fetched = String::new();
754754
let mut first_err = None;
755-
let backtrack = opts.desc.channel == "nightly" && opts.desc.date.is_none();
755+
let backtrack = opts.toolchain.channel == "nightly" && opts.toolchain.date.is_none();
756756
// We want to limit backtracking if we do not already have a toolchain
757-
let mut backtrack_limit: Option<i32> = if opts.desc.date.is_some() {
757+
let mut backtrack_limit: Option<i32> = if opts.toolchain.date.is_some() {
758758
None
759759
} else {
760760
// We limit the backtracking to 21 days by default (half a release cycle).
@@ -792,11 +792,11 @@ pub(crate) async fn update_from_dist(
792792
};
793793

794794
let current_manifest = {
795-
let manifestation = Manifestation::open(prefix.clone(), opts.desc.target.clone())?;
795+
let manifestation = Manifestation::open(prefix.clone(), opts.toolchain.target.clone())?;
796796
manifestation.load_manifest()?
797797
};
798798

799-
let mut toolchain = opts.desc.clone();
799+
let mut toolchain = opts.toolchain.clone();
800800
let res = loop {
801801
let result = try_update_from_dist_(
802802
opts.dl_cfg,

src/install.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ impl<'a> InstallMethod<'a> {
132132
match self {
133133
InstallMethod::Copy { dest, .. } => (*dest).into(),
134134
InstallMethod::Link { dest, .. } => (*dest).into(),
135-
InstallMethod::Dist(DistOptions { desc, .. }) => (*desc).into(),
135+
InstallMethod::Dist(DistOptions {
136+
toolchain: desc, ..
137+
}) => (*desc).into(),
136138
}
137139
}
138140

@@ -144,9 +146,11 @@ impl<'a> InstallMethod<'a> {
144146
match self {
145147
InstallMethod::Copy { cfg, dest, .. } => cfg.toolchain_path(&(*dest).into()),
146148
InstallMethod::Link { cfg, dest, .. } => cfg.toolchain_path(&(*dest).into()),
147-
InstallMethod::Dist(DistOptions { cfg, desc, .. }) => {
148-
cfg.toolchain_path(&(*desc).into())
149-
}
149+
InstallMethod::Dist(DistOptions {
150+
cfg,
151+
toolchain: desc,
152+
..
153+
}) => cfg.toolchain_path(&(*desc).into()),
150154
}
151155
}
152156
}

src/toolchain/distributable.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,18 @@ impl<'a> DistributableToolchain<'a> {
327327
#[cfg_attr(feature = "otel", tracing::instrument(err, skip_all))]
328328
pub(crate) async fn install(
329329
cfg: &'a Cfg<'a>,
330-
desc: &ToolchainDesc,
330+
toolchain: &ToolchainDesc,
331331
components: &[&str],
332332
targets: &[&str],
333333
profile: Profile,
334334
force: bool,
335335
) -> anyhow::Result<(UpdateStatus, DistributableToolchain<'a>)> {
336-
let hash_path = cfg.get_hash_file(desc, true)?;
336+
let hash_path = cfg.get_hash_file(toolchain, true)?;
337337
let update_hash = Some(&hash_path as &Path);
338338

339339
let status = InstallMethod::Dist(DistOptions {
340340
cfg,
341-
desc,
341+
toolchain,
342342
profile,
343343
update_hash,
344344
dl_cfg: cfg.download_cfg(&|n| (cfg.notify_handler)(n.into())),
@@ -351,7 +351,7 @@ impl<'a> DistributableToolchain<'a> {
351351
})
352352
.install()
353353
.await?;
354-
Ok((status, Self::new(cfg, desc.clone())?))
354+
Ok((status, Self::new(cfg, toolchain.clone())?))
355355
}
356356

357357
#[cfg_attr(feature = "otel", tracing::instrument(err, skip_all))]
@@ -414,7 +414,7 @@ impl<'a> DistributableToolchain<'a> {
414414

415415
InstallMethod::Dist(DistOptions {
416416
cfg,
417-
desc: &self.desc,
417+
toolchain: &self.desc,
418418
profile,
419419
update_hash,
420420
dl_cfg: cfg.download_cfg(&|n| (cfg.notify_handler)(n.into())),

0 commit comments

Comments
 (0)