Skip to content

Commit dad9c04

Browse files
committed
notifications: log directly when setting profile
1 parent 197a607 commit dad9c04

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ mod tests {
14251425
);
14261426
assert_eq!(
14271427
for_host!(
1428-
r"info: profile set to 'default'
1428+
r"info: profile set to default
14291429
info: default host triple is {0}
14301430
"
14311431
),

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'a> Cfg<'a> {
359359
s.profile = Some(profile);
360360
Ok(())
361361
})?;
362-
(self.notify_handler)(Notification::SetProfile(profile.as_str()));
362+
info!("profile set to {}", profile.as_str());
363363
Ok(())
364364
}
365365

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-
SetProfile(&'a str),
3029
SetSelfUpdate(&'a str),
3130
LookingForToolchain(&'a ToolchainDesc),
3231
ToolchainDirectory(&'a Path),
@@ -67,8 +66,7 @@ impl Notification<'_> {
6766
| ReadMetadataVersion(_)
6867
| InstalledToolchain(_)
6968
| UpdateHashMatches => NotificationLevel::Debug,
70-
SetProfile(_)
71-
| SetSelfUpdate(_)
69+
SetSelfUpdate(_)
7270
| UsingExistingToolchain(_)
7371
| UninstallingToolchain(_)
7472
| UninstalledToolchain(_)
@@ -102,7 +100,6 @@ impl Display for Notification<'_> {
102100
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
103101
DownloadFinished(_) => write!(f, "download finished"),
104102
DownloadFailed(_) => write!(f, "download failed"),
105-
SetProfile(name) => write!(f, "profile set to '{name}'"),
106103
SetSelfUpdate(mode) => write!(f, "auto-self-update mode set to '{mode}'"),
107104
LookingForToolchain(name) => write!(f, "looking for installed toolchain '{name}'"),
108105
ToolchainDirectory(path) => write!(f, "toolchain directory: '{}'", path.display()),

0 commit comments

Comments
 (0)