Skip to content

Commit dceb0a1

Browse files
committed
notifications: log directly when toolchain is up to date
1 parent 901fbe1 commit dceb0a1

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/install.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::{
99
config::Cfg,
1010
dist::{self, DistOptions, prefix::InstallPrefix},
1111
errors::RustupError,
12-
notifications::Notification,
1312
toolchain::{CustomToolchainName, LocalToolchainName, Toolchain},
1413
utils,
1514
};
@@ -45,7 +44,6 @@ impl InstallMethod<'_> {
4544
let _ = rayon::ThreadPoolBuilder::new()
4645
.num_threads(self.cfg().process.io_thread_count()?)
4746
.build_global();
48-
let nh = &self.cfg().notify_handler;
4947
match self {
5048
InstallMethod::Copy { .. }
5149
| InstallMethod::Link { .. }
@@ -61,7 +59,7 @@ impl InstallMethod<'_> {
6159

6260
let status = match updated {
6361
false => {
64-
nh(Notification::UpdateHashMatches);
62+
debug!("toolchain is already up to date");
6563
UpdateStatus::Unchanged
6664
}
6765
true => {

src/notifications.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub(crate) enum Notification<'a> {
2828
SetDefaultBufferSize(usize),
2929
UninstallingToolchain(&'a ToolchainName),
3030
UninstalledToolchain(&'a ToolchainName),
31-
UpdateHashMatches,
3231
UpgradingMetadata(MetadataVersion, MetadataVersion),
3332
MetadataUpgradeNotNeeded(MetadataVersion),
3433
ReadMetadataVersion(MetadataVersion),
@@ -52,9 +51,7 @@ impl Notification<'_> {
5251
| DownloadDataReceived(_, _)
5352
| DownloadFinished(_)
5453
| DownloadFailed(_) => NotificationLevel::Debug,
55-
ReadMetadataVersion(_) | UpdateHashMatches => {
56-
NotificationLevel::Debug
57-
}
54+
ReadMetadataVersion(_) => NotificationLevel::Debug,
5855
UninstallingToolchain(_)
5956
| UninstalledToolchain(_)
6057
| UpgradingMetadata(_, _)
@@ -89,7 +86,6 @@ impl Display for Notification<'_> {
8986
DownloadFailed(_) => write!(f, "download failed"),
9087
UninstallingToolchain(name) => write!(f, "uninstalling toolchain '{name}'"),
9188
UninstalledToolchain(name) => write!(f, "toolchain '{name}' uninstalled"),
92-
UpdateHashMatches => write!(f, "toolchain is already up to date"),
9389
UpgradingMetadata(from_ver, to_ver) => write!(
9490
f,
9591
"upgrading metadata version from '{from_ver}' to '{to_ver}'"

0 commit comments

Comments
 (0)