Skip to content

Commit 1844a92

Browse files
committed
Update notification for removing component
Use update_from_dist flag for Notification::RemovingOldComponent Rename explicit_modify param in update fn of dist manifestitation Rename implicit_modify param in update fn of dist manifestitation
1 parent c115fd2 commit 1844a92

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/dist/dist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ fn try_update_from_dist_<'a>(
731731
&download,
732732
&download.notify_handler,
733733
&toolchain.manifest_name(),
734+
true,
734735
)? {
735736
UpdateStatus::Unchanged => Ok(None),
736737
UpdateStatus::Changed => Ok(Some(hash)),

src/dist/manifestation.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ impl Manifestation {
108108
download_cfg: &DownloadCfg<'_>,
109109
notify_handler: &dyn Fn(Notification<'_>),
110110
toolchain_str: &str,
111+
implicit_modify: bool,
111112
) -> Result<UpdateStatus> {
112113
// Some vars we're going to need a few times
113114
let temp_cfg = download_cfg.temp_cfg;
@@ -168,7 +169,7 @@ impl Manifestation {
168169

169170
// Uninstall components
170171
for component in &update.components_to_uninstall {
171-
let notification = if altered {
172+
let notification = if implicit_modify {
172173
Notification::RemovingOldComponent
173174
} else {
174175
Notification::RemovingComponent

src/toolchain.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ impl<'a> Toolchain<'a> {
710710
&self.download_cfg(),
711711
&self.download_cfg().notify_handler,
712712
&toolchain.manifest_name(),
713+
false,
713714
)?;
714715

715716
Ok(())
@@ -763,6 +764,7 @@ impl<'a> Toolchain<'a> {
763764
&self.download_cfg(),
764765
&self.download_cfg().notify_handler,
765766
&toolchain.manifest_name(),
767+
false,
766768
)?;
767769

768770
Ok(())

tests/dist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ fn update_from_dist(
460460
download_cfg,
461461
download_cfg.notify_handler,
462462
&toolchain.manifest_name(),
463+
true,
463464
)
464465
}
465466

0 commit comments

Comments
 (0)