Skip to content

Commit 59e8991

Browse files
committed
notifications: log directly when upgrading metadata version
1 parent bf82edf commit 59e8991

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/config.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,10 @@ impl<'a> Cfg<'a> {
448448
return Ok(());
449449
}
450450

451-
(self.notify_handler)(Notification::UpgradingMetadata(
452-
current_version,
453-
MetadataVersion::default(),
454-
));
455-
451+
info!(
452+
"upgrading metadata version from {current_version} to {}",
453+
MetadataVersion::default()
454+
);
456455
match current_version {
457456
MetadataVersion::V2 => {
458457
// The toolchain installation format changed. Just delete them all.

src/notifications.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub(crate) enum Notification<'a> {
2626
/// member, but the notification callback is already narrowed to
2727
/// utils::notifications by the time tar unpacking is called.
2828
SetDefaultBufferSize(usize),
29-
UpgradingMetadata(MetadataVersion, MetadataVersion),
3029
MetadataUpgradeNotNeeded(MetadataVersion),
3130
ReadMetadataVersion(MetadataVersion),
3231
UpgradeRemovesToolchains,
@@ -50,7 +49,7 @@ impl Notification<'_> {
5049
| DownloadFinished(_)
5150
| DownloadFailed(_) => NotificationLevel::Debug,
5251
ReadMetadataVersion(_) => NotificationLevel::Debug,
53-
UpgradingMetadata(_, _) | MetadataUpgradeNotNeeded(_) => NotificationLevel::Info,
52+
MetadataUpgradeNotNeeded(_) => NotificationLevel::Info,
5453
UpgradeRemovesToolchains | DuplicateToolchainFile { .. } => NotificationLevel::Warn,
5554
}
5655
}
@@ -79,10 +78,6 @@ impl Display for Notification<'_> {
7978
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
8079
DownloadFinished(_) => write!(f, "download finished"),
8180
DownloadFailed(_) => write!(f, "download failed"),
82-
UpgradingMetadata(from_ver, to_ver) => write!(
83-
f,
84-
"upgrading metadata version from '{from_ver}' to '{to_ver}'"
85-
),
8681
MetadataUpgradeNotNeeded(ver) => {
8782
write!(f, "nothing to upgrade: metadata version is already '{ver}'")
8883
}

0 commit comments

Comments
 (0)