Skip to content

Commit

Permalink
Update notification for removing component
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BeniCheni committed Sep 27, 2019
1 parent c115fd2 commit 1844a92
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ fn try_update_from_dist_<'a>(
&download,
&download.notify_handler,
&toolchain.manifest_name(),
true,
)? {
UpdateStatus::Unchanged => Ok(None),
UpdateStatus::Changed => Ok(Some(hash)),
Expand Down
3 changes: 2 additions & 1 deletion src/dist/manifestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl Manifestation {
download_cfg: &DownloadCfg<'_>,
notify_handler: &dyn Fn(Notification<'_>),
toolchain_str: &str,
implicit_modify: bool,
) -> Result<UpdateStatus> {
// Some vars we're going to need a few times
let temp_cfg = download_cfg.temp_cfg;
Expand Down Expand Up @@ -168,7 +169,7 @@ impl Manifestation {

// Uninstall components
for component in &update.components_to_uninstall {
let notification = if altered {
let notification = if implicit_modify {
Notification::RemovingOldComponent
} else {
Notification::RemovingComponent
Expand Down
2 changes: 2 additions & 0 deletions src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ impl<'a> Toolchain<'a> {
&self.download_cfg(),
&self.download_cfg().notify_handler,
&toolchain.manifest_name(),
false,
)?;

Ok(())
Expand Down Expand Up @@ -763,6 +764,7 @@ impl<'a> Toolchain<'a> {
&self.download_cfg(),
&self.download_cfg().notify_handler,
&toolchain.manifest_name(),
false,
)?;

Ok(())
Expand Down
1 change: 1 addition & 0 deletions tests/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ fn update_from_dist(
download_cfg,
download_cfg.notify_handler,
&toolchain.manifest_name(),
true,
)
}

Expand Down

0 comments on commit 1844a92

Please sign in to comment.