@@ -322,33 +322,23 @@ pub struct RustfmtMetadata {
322322 pub version : String ,
323323}
324324
325- #[ derive( Clone , Debug ) ]
325+ #[ derive( Clone , Debug , Default ) ]
326326pub enum RustfmtState {
327327 SystemToolchain ( PathBuf ) ,
328328 Downloaded ( PathBuf ) ,
329329 Unavailable ,
330+ #[ default]
330331 LazyEvaluated ,
331332}
332333
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 ) ]
340335pub enum LlvmLibunwind {
336+ #[ default]
341337 No ,
342338 InTree ,
343339 System ,
344340}
345341
346- impl Default for LlvmLibunwind {
347- fn default ( ) -> Self {
348- Self :: No
349- }
350- }
351-
352342impl FromStr for LlvmLibunwind {
353343 type Err = String ;
354344
@@ -362,19 +352,14 @@ impl FromStr for LlvmLibunwind {
362352 }
363353}
364354
365- #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
355+ #[ derive( Default , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
366356pub enum SplitDebuginfo {
367357 Packed ,
368358 Unpacked ,
359+ #[ default]
369360 Off ,
370361}
371362
372- impl Default for SplitDebuginfo {
373- fn default ( ) -> Self {
374- SplitDebuginfo :: Off
375- }
376- }
377-
378363impl std:: str:: FromStr for SplitDebuginfo {
379364 type Err = ( ) ;
380365
@@ -1529,7 +1514,7 @@ impl Config {
15291514 let asserts = llvm_assertions. unwrap_or ( false ) ;
15301515 config. llvm_from_ci = match llvm. download_ci_llvm {
15311516 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" ) ;
15331518 crate :: llvm:: is_ci_llvm_available ( & config, asserts)
15341519 }
15351520 Some ( StringOrBool :: Bool ( b) ) => b,
0 commit comments