@@ -10,15 +10,13 @@ use crate::utils::units;
10
10
use crate :: { dist:: ToolchainDesc , toolchain:: ToolchainName , utils:: notify:: NotificationLevel } ;
11
11
12
12
#[ derive( Debug ) ]
13
- pub enum Notification < ' a > {
14
- Extracting ( & ' a Path , & ' a Path ) ,
13
+ pub ( crate ) enum Notification < ' a > {
15
14
ComponentAlreadyInstalled ( & ' a str ) ,
16
15
CantReadUpdateHash ( & ' a Path ) ,
17
16
NoUpdateHash ( & ' a Path ) ,
18
17
ChecksumValid ( & ' a str ) ,
19
18
FileAlreadyDownloaded ,
20
19
CachedFileChecksumFailed ,
21
- ExtensionNotInstalled ( & ' a str ) ,
22
20
MissingInstalledComponent ( & ' a str ) ,
23
21
/// The URL of the download is passed as the last argument, to allow us to track concurrent downloads.
24
22
DownloadingComponent ( & ' a str , & ' a TargetTriple , Option < & ' a TargetTriple > , & ' a str ) ,
@@ -30,11 +28,9 @@ pub enum Notification<'a> {
30
28
DownloadingLegacyManifest ,
31
29
SkippingNightlyMissingComponent ( & ' a ToolchainDesc , & ' a Manifest , & ' a [ Component ] ) ,
32
30
ForcingUnavailableComponent ( & ' a str ) ,
33
- ComponentUnavailable ( & ' a str , Option < & ' a TargetTriple > ) ,
34
31
StrayHash ( & ' a Path ) ,
35
- SignatureInvalid ( & ' a str ) ,
36
32
RetryingDownload ( & ' a str ) ,
37
- DownloadingFile ( & ' a Url , & ' a Path ) ,
33
+ DownloadingFile ( & ' a Url ) ,
38
34
/// Received the Content-Length of the to-be downloaded data with
39
35
/// the respective URL of the download (for tracking concurrent downloads).
40
36
DownloadContentLengthReceived ( u64 , Option < & ' a str > ) ,
@@ -85,8 +81,7 @@ impl Notification<'_> {
85
81
| NoUpdateHash ( _)
86
82
| FileAlreadyDownloaded
87
83
| DownloadingLegacyManifest => NotificationLevel :: Debug ,
88
- Extracting ( _, _)
89
- | DownloadingComponent ( _, _, _, _)
84
+ DownloadingComponent ( _, _, _, _)
90
85
| InstallingComponent ( _, _, _)
91
86
| RemovingComponent ( _, _, _)
92
87
| RemovingOldComponent ( _, _, _)
@@ -96,15 +91,12 @@ impl Notification<'_> {
96
91
| RetryingDownload ( _)
97
92
| DownloadedManifest ( _, _) => NotificationLevel :: Info ,
98
93
CantReadUpdateHash ( _)
99
- | ExtensionNotInstalled ( _)
100
94
| MissingInstalledComponent ( _)
101
95
| CachedFileChecksumFailed
102
- | ComponentUnavailable ( _, _)
103
96
| ForcingUnavailableComponent ( _)
104
97
| StrayHash ( _) => NotificationLevel :: Warn ,
105
- SignatureInvalid ( _) => NotificationLevel :: Warn ,
106
98
SetDefaultBufferSize ( _) => NotificationLevel :: Trace ,
107
- DownloadingFile ( _, _ )
99
+ DownloadingFile ( _)
108
100
| DownloadContentLengthReceived ( _, _)
109
101
| DownloadDataReceived ( _, _)
110
102
| DownloadFinished ( _)
@@ -139,18 +131,16 @@ impl Display for Notification<'_> {
139
131
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> std:: result:: Result < ( ) , fmt:: Error > {
140
132
use self :: Notification :: * ;
141
133
match self {
142
- Extracting ( _, _) => write ! ( f, "extracting..." ) ,
143
134
ComponentAlreadyInstalled ( c) => write ! ( f, "component {c} is up to date" ) ,
144
135
CantReadUpdateHash ( path) => write ! (
145
136
f,
146
137
"can't read update hash file: '{}', can't skip update..." ,
147
138
path. display( )
148
139
) ,
149
140
NoUpdateHash ( path) => write ! ( f, "no update hash at: '{}'" , path. display( ) ) ,
150
- ChecksumValid ( _ ) => write ! ( f, "checksum passed" ) ,
141
+ ChecksumValid ( url ) => write ! ( f, "checksum passed for {url} " ) ,
151
142
FileAlreadyDownloaded => write ! ( f, "reusing previously downloaded file" ) ,
152
143
CachedFileChecksumFailed => write ! ( f, "bad checksum for cached download" ) ,
153
- ExtensionNotInstalled ( c) => write ! ( f, "extension '{c}' was not installed" ) ,
154
144
MissingInstalledComponent ( c) => {
155
145
write ! ( f, "during uninstall component {c} was not found" )
156
146
}
@@ -195,13 +185,6 @@ impl Display for Notification<'_> {
195
185
write ! ( f, "latest update on {date}, no rust version" )
196
186
}
197
187
DownloadingLegacyManifest => write ! ( f, "manifest not found. trying legacy manifest" ) ,
198
- ComponentUnavailable ( pkg, toolchain) => {
199
- if let Some ( tc) = toolchain {
200
- write ! ( f, "component '{pkg}' is not available on target '{tc}'" )
201
- } else {
202
- write ! ( f, "component '{pkg}' is not available" )
203
- }
204
- }
205
188
StrayHash ( path) => write ! (
206
189
f,
207
190
"removing stray hash found at '{}' in order to continue" ,
@@ -226,15 +209,14 @@ impl Display for Notification<'_> {
226
209
ForcingUnavailableComponent ( component) => {
227
210
write ! ( f, "Force-skipping unavailable component '{component}'" )
228
211
}
229
- SignatureInvalid ( url) => write ! ( f, "Signature verification failed for '{url}'" ) ,
230
212
RetryingDownload ( url) => write ! ( f, "retrying download for '{url}'" ) ,
231
213
Error ( e) => write ! ( f, "error: '{e}'" ) ,
232
214
SetDefaultBufferSize ( size) => write ! (
233
215
f,
234
216
"using up to {} of RAM to unpack components" ,
235
217
units:: Size :: new( * size)
236
218
) ,
237
- DownloadingFile ( url, _ ) => write ! ( f, "downloading file from: '{url}'" ) ,
219
+ DownloadingFile ( url) => write ! ( f, "downloading file from: '{url}'" ) ,
238
220
DownloadContentLengthReceived ( len, _) => write ! ( f, "download size is: '{len}'" ) ,
239
221
DownloadDataReceived ( data, _) => write ! ( f, "received some data of size {}" , data. len( ) ) ,
240
222
DownloadFinished ( _) => write ! ( f, "download finished" ) ,
0 commit comments