@@ -185,7 +185,9 @@ impl Registry {
185
185
( json. len ( ) >> 8 ) as u8 ,
186
186
( json. len ( ) >> 16 ) as u8 ,
187
187
( json. len ( ) >> 24 ) as u8 ,
188
- ] . iter ( ) . cloned ( ) ,
188
+ ]
189
+ . iter ( )
190
+ . cloned ( ) ,
189
191
) ;
190
192
w. extend ( json. as_bytes ( ) . iter ( ) . cloned ( ) ) ;
191
193
w. extend (
@@ -194,7 +196,9 @@ impl Registry {
194
196
( stat. len ( ) >> 8 ) as u8 ,
195
197
( stat. len ( ) >> 16 ) as u8 ,
196
198
( stat. len ( ) >> 24 ) as u8 ,
197
- ] . iter ( ) . cloned ( ) ,
199
+ ]
200
+ . iter ( )
201
+ . cloned ( ) ,
198
202
) ;
199
203
w
200
204
} ;
@@ -337,17 +341,17 @@ impl Registry {
337
341
Ok ( body) => body,
338
342
Err ( ..) => bail ! ( "response body was not valid utf-8" ) ,
339
343
} ;
340
- let errors = serde_json:: from_str :: < ApiErrorList > ( & body) . ok ( ) . map ( |s| {
341
- s . errors . into_iter ( ) . map ( |s| s . detail ) . collect :: < Vec < _ > > ( )
342
- } ) ;
344
+ let errors = serde_json:: from_str :: < ApiErrorList > ( & body)
345
+ . ok ( )
346
+ . map ( |s| s . errors . into_iter ( ) . map ( |s| s . detail ) . collect :: < Vec < _ > > ( ) ) ;
343
347
344
348
match ( self . handle . response_code ( ) ?, errors) {
345
- ( 0 , None ) | ( 200 , None ) => { } ,
346
- ( 503 , None ) if started. elapsed ( ) . as_secs ( ) >= 29 && self . host_is_crates_io ( ) => {
347
- bail ! ( "Request timed out after 30 seconds. If you're trying to \
348
- upload a crate it may be too large. If the crate is under \
349
- 10MB in size, you can email [email protected] for assistance.")
350
- }
349
+ ( 0 , None ) | ( 200 , None ) => { }
350
+ ( 503 , None ) if started. elapsed ( ) . as_secs ( ) >= 29 && self . host_is_crates_io ( ) => bail ! (
351
+ "Request timed out after 30 seconds. If you're trying to \
352
+ upload a crate it may be too large. If the crate is under \
353
+ 10MB in size, you can email [email protected] for assistance."
354
+ ) ,
351
355
( code, Some ( errors) ) => {
352
356
let code = StatusCode :: from_u16 ( code as _ ) ?;
353
357
bail ! ( "api errors (status {}): {}" , code, errors. join( ", " ) )
@@ -358,9 +362,9 @@ impl Registry {
358
362
\t {}\n \
359
363
body:\n \
360
364
{}",
361
- code,
362
- headers. join( "\n \t " ) ,
363
- body,
365
+ code,
366
+ headers. join( "\n \t " ) ,
367
+ body,
364
368
) ,
365
369
}
366
370
0 commit comments