Skip to content

Commit 30c2580

Browse files
committed
notifications: log directly when reading metadata version
1 parent 6d1fc26 commit 30c2580

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl<'a> Cfg<'a> {
251251

252252
let settings_file = SettingsFile::new(rustup_dir.join("settings.toml"));
253253
settings_file.with(|s| {
254-
(notify_handler)(Notification::ReadMetadataVersion(s.version));
254+
debug!("read metadata version: {}", s.version);
255255
if s.version == MetadataVersion::default() {
256256
Ok(())
257257
} else {

src/notifications.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::fmt::{self, Display};
22
use std::path::{Path, PathBuf};
33

44
use crate::dist::TargetTriple;
5-
use crate::settings::MetadataVersion;
65
use crate::utils::notify::NotificationLevel;
76
use crate::utils::units;
87

@@ -26,7 +25,6 @@ pub(crate) enum Notification<'a> {
2625
/// member, but the notification callback is already narrowed to
2726
/// utils::notifications by the time tar unpacking is called.
2827
SetDefaultBufferSize(usize),
29-
ReadMetadataVersion(MetadataVersion),
3028
UpgradeRemovesToolchains,
3129
/// Both `rust-toolchain` and `rust-toolchain.toml` exist within a directory
3230
DuplicateToolchainFile {
@@ -47,7 +45,6 @@ impl Notification<'_> {
4745
| DownloadDataReceived(_, _)
4846
| DownloadFinished(_)
4947
| DownloadFailed(_) => NotificationLevel::Debug,
50-
ReadMetadataVersion(_) => NotificationLevel::Debug,
5148
UpgradeRemovesToolchains | DuplicateToolchainFile { .. } => NotificationLevel::Warn,
5249
}
5350
}
@@ -76,7 +73,6 @@ impl Display for Notification<'_> {
7673
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
7774
DownloadFinished(_) => write!(f, "download finished"),
7875
DownloadFailed(_) => write!(f, "download failed"),
79-
ReadMetadataVersion(ver) => write!(f, "read metadata version: '{ver}'"),
8076
UpgradeRemovesToolchains => write!(
8177
f,
8278
"this upgrade will remove all existing toolchains. you will need to reinstall them"

0 commit comments

Comments
 (0)