Skip to content

Commit 6d1fc26

Browse files
committed
notifications: log directly when metadata upgrade is not needed
1 parent 59e8991 commit 6d1fc26

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ impl<'a> Cfg<'a> {
444444
pub(crate) fn upgrade_data(&self) -> Result<()> {
445445
let current_version = self.settings_file.with(|s| Ok(s.version))?;
446446
if current_version == MetadataVersion::default() {
447-
(self.notify_handler)(Notification::MetadataUpgradeNotNeeded(current_version));
447+
info!("nothing to upgrade: metadata version is already '{current_version}'");
448448
return Ok(());
449449
}
450450

src/notifications.rs

Lines changed: 0 additions & 5 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-
MetadataUpgradeNotNeeded(MetadataVersion),
3029
ReadMetadataVersion(MetadataVersion),
3130
UpgradeRemovesToolchains,
3231
/// Both `rust-toolchain` and `rust-toolchain.toml` exist within a directory
@@ -49,7 +48,6 @@ impl Notification<'_> {
4948
| DownloadFinished(_)
5049
| DownloadFailed(_) => NotificationLevel::Debug,
5150
ReadMetadataVersion(_) => NotificationLevel::Debug,
52-
MetadataUpgradeNotNeeded(_) => NotificationLevel::Info,
5351
UpgradeRemovesToolchains | DuplicateToolchainFile { .. } => NotificationLevel::Warn,
5452
}
5553
}
@@ -78,9 +76,6 @@ impl Display for Notification<'_> {
7876
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
7977
DownloadFinished(_) => write!(f, "download finished"),
8078
DownloadFailed(_) => write!(f, "download failed"),
81-
MetadataUpgradeNotNeeded(ver) => {
82-
write!(f, "nothing to upgrade: metadata version is already '{ver}'")
83-
}
8479
ReadMetadataVersion(ver) => write!(f, "read metadata version: '{ver}'"),
8580
UpgradeRemovesToolchains => write!(
8681
f,

0 commit comments

Comments
 (0)