Skip to content

Commit 75ccb12

Browse files
committed
notifications: log directly when resuming partial downloads
1 parent 6fe636b commit 75ccb12

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/download/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ async fn download_file_(
124124
Event::DownloadDataReceived(data) => {
125125
notify_handler(Notification::DownloadDataReceived(data, Some(url.as_str())));
126126
}
127-
Event::ResumingPartialDownload => {
128-
notify_handler(Notification::ResumingPartialDownload);
129-
}
127+
Event::ResumingPartialDownload => debug!("resuming partial download"),
130128
}
131129

132130
Ok(())

src/notifications.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub(crate) enum Notification<'a> {
2222
DownloadFinished(Option<&'a str>),
2323
/// Download has failed.
2424
DownloadFailed(&'a str),
25-
ResumingPartialDownload,
2625
/// This would make more sense as a crate::notifications::Notification
2726
/// member, but the notification callback is already narrowed to
2827
/// utils::notifications by the time tar unpacking is called.
@@ -63,8 +62,7 @@ impl Notification<'_> {
6362
DownloadContentLengthReceived(_, _)
6463
| DownloadDataReceived(_, _)
6564
| DownloadFinished(_)
66-
| DownloadFailed(_)
67-
| ResumingPartialDownload => NotificationLevel::Debug,
65+
| DownloadFailed(_) => NotificationLevel::Debug,
6866
ToolchainDirectory(_)
6967
| LookingForToolchain(_)
7068
| InstallingToolchain(_)
@@ -110,7 +108,6 @@ impl Display for Notification<'_> {
110108
DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()),
111109
DownloadFinished(_) => write!(f, "download finished"),
112110
DownloadFailed(_) => write!(f, "download failed"),
113-
ResumingPartialDownload => write!(f, "resuming partial download"),
114111
SetAutoInstall(auto) => write!(f, "auto install set to '{auto}'"),
115112
SetDefaultToolchain(None) => write!(f, "default toolchain unset"),
116113
SetDefaultToolchain(Some(name)) => write!(f, "default toolchain set to '{name}'"),

0 commit comments

Comments
 (0)