Skip to content

Commit fa6b72b

Browse files
committed
notifications: log directly when setting auto install mode
1 parent 75ccb12 commit fa6b72b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use anyhow::{Context, Result, anyhow, bail};
88
use serde::Deserialize;
99
use thiserror::Error as ThisError;
1010
use tokio_stream::StreamExt;
11-
use tracing::{error, trace};
11+
use tracing::{error, info, trace};
1212

1313
use crate::dist::AutoInstallMode;
1414
use crate::{
@@ -376,7 +376,7 @@ impl<'a> Cfg<'a> {
376376
s.auto_install = Some(mode);
377377
Ok(())
378378
})?;
379-
(self.notify_handler)(Notification::SetAutoInstall(mode.as_str()));
379+
info!(new = mode.as_str(), "setting auto install mode");
380380
Ok(())
381381
}
382382

src/notifications.rs

Lines changed: 1 addition & 4 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-
SetAutoInstall(&'a str),
3029
SetDefaultToolchain(Option<&'a ToolchainName>),
3130
SetOverrideToolchain(&'a Path, &'a str),
3231
SetProfile(&'a str),
@@ -70,8 +69,7 @@ impl Notification<'_> {
7069
| ReadMetadataVersion(_)
7170
| InstalledToolchain(_)
7271
| UpdateHashMatches => NotificationLevel::Debug,
73-
SetAutoInstall(_)
74-
| SetDefaultToolchain(_)
72+
SetDefaultToolchain(_)
7573
| SetOverrideToolchain(_, _)
7674
| SetProfile(_)
7775
| SetSelfUpdate(_)
@@ -108,7 +106,6 @@ impl Display for Notification<'_> {
108106
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
109107
DownloadFinished(_) => write!(f, "download finished"),
110108
DownloadFailed(_) => write!(f, "download failed"),
111-
SetAutoInstall(auto) => write!(f, "auto install set to '{auto}'"),
112109
SetDefaultToolchain(None) => write!(f, "default toolchain unset"),
113110
SetDefaultToolchain(Some(name)) => write!(f, "default toolchain set to '{name}'"),
114111
SetOverrideToolchain(path, name) => write!(

0 commit comments

Comments
 (0)