Skip to content

Commit 0369796

Browse files
committed
notifications: log directly when setting profile
1 parent 927c120 commit 0369796

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

src/cli/self_update.rs

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

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()),

tests/suite/cli_misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ error: override toolchain 'foo' is not installed: the +toolchain on the command
15201520
.expect(["rustup", "+stable", "set", "profile", "minimal"])
15211521
.await
15221522
.with_stderr(snapbox::str![[r#"
1523-
info: profile set to 'minimal'
1523+
info: profile set to minimal
15241524
15251525
"#]])
15261526
.is_ok();

0 commit comments

Comments
 (0)