@@ -322,33 +322,23 @@ pub struct RustfmtMetadata {
322
322
pub version : String ,
323
323
}
324
324
325
- #[ derive( Clone , Debug ) ]
325
+ #[ derive( Clone , Debug , Default ) ]
326
326
pub enum RustfmtState {
327
327
SystemToolchain ( PathBuf ) ,
328
328
Downloaded ( PathBuf ) ,
329
329
Unavailable ,
330
+ #[ default]
330
331
LazyEvaluated ,
331
332
}
332
333
333
- impl Default for RustfmtState {
334
- fn default ( ) -> Self {
335
- RustfmtState :: LazyEvaluated
336
- }
337
- }
338
-
339
- #[ derive( Debug , Clone , Copy , PartialEq ) ]
334
+ #[ derive( Debug , Default , Clone , Copy , PartialEq ) ]
340
335
pub enum LlvmLibunwind {
336
+ #[ default]
341
337
No ,
342
338
InTree ,
343
339
System ,
344
340
}
345
341
346
- impl Default for LlvmLibunwind {
347
- fn default ( ) -> Self {
348
- Self :: No
349
- }
350
- }
351
-
352
342
impl FromStr for LlvmLibunwind {
353
343
type Err = String ;
354
344
@@ -362,19 +352,14 @@ impl FromStr for LlvmLibunwind {
362
352
}
363
353
}
364
354
365
- #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
355
+ #[ derive( Default , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
366
356
pub enum SplitDebuginfo {
367
357
Packed ,
368
358
Unpacked ,
359
+ #[ default]
369
360
Off ,
370
361
}
371
362
372
- impl Default for SplitDebuginfo {
373
- fn default ( ) -> Self {
374
- SplitDebuginfo :: Off
375
- }
376
- }
377
-
378
363
impl std:: str:: FromStr for SplitDebuginfo {
379
364
type Err = ( ) ;
380
365
@@ -1529,7 +1514,7 @@ impl Config {
1529
1514
let asserts = llvm_assertions. unwrap_or ( false ) ;
1530
1515
config. llvm_from_ci = match llvm. download_ci_llvm {
1531
1516
Some ( StringOrBool :: String ( s) ) => {
1532
- assert ! ( s == "if-available" , "unknown option `{s}` for download-ci-llvm" ) ;
1517
+ assert_eq ! ( s, "if-available" , "unknown option `{s}` for download-ci-llvm" ) ;
1533
1518
crate :: llvm:: is_ci_llvm_available ( & config, asserts)
1534
1519
}
1535
1520
Some ( StringOrBool :: Bool ( b) ) => b,
0 commit comments