Skip to content

Commit 473381a

Browse files
committed
notifications: log directly on temp root creation
1 parent 1b0bba3 commit 473381a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/dist/temp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Context {
9191

9292
pub(crate) fn create_root(&self) -> Result<bool> {
9393
raw::ensure_dir_exists(&self.root_directory, |p| {
94-
(self.notify_handler)(Notification::CreatingRoot(p));
94+
debug!(path = %p.display(), "creating temp root");
9595
})
9696
.with_context(|| CreatingError::Root(PathBuf::from(&self.root_directory)))
9797
}

src/notifications.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ pub enum Notification<'a> {
5252
Error(String),
5353
UsingCurl,
5454
UsingReqwest,
55-
CreatingRoot(&'a Path),
5655
CreatingFile(&'a Path),
5756
SetAutoInstall(&'a str),
5857
SetDefaultToolchain(Option<&'a ToolchainName>),
@@ -115,7 +114,7 @@ impl Notification<'_> {
115114
| UsingCurl
116115
| UsingReqwest => NotificationLevel::Debug,
117116
Error(_) => NotificationLevel::Error,
118-
CreatingRoot(_) | CreatingFile(_) => NotificationLevel::Debug,
117+
CreatingFile(_) => NotificationLevel::Debug,
119118
ToolchainDirectory(_)
120119
| LookingForToolchain(_)
121120
| InstallingToolchain(_)
@@ -245,7 +244,6 @@ impl Display for Notification<'_> {
245244
ResumingPartialDownload => write!(f, "resuming partial download"),
246245
UsingCurl => write!(f, "downloading with curl"),
247246
UsingReqwest => write!(f, "downloading with reqwest"),
248-
CreatingRoot(path) => write!(f, "creating temp root: {}", path.display()),
249247
CreatingFile(path) => write!(f, "creating temp file: {}", path.display()),
250248
SetAutoInstall(auto) => write!(f, "auto install set to '{auto}'"),
251249
SetDefaultToolchain(None) => write!(f, "default toolchain unset"),

0 commit comments

Comments
 (0)