@@ -459,11 +459,7 @@ impl Integer {
459459 }
460460 }
461461
462- let at_least = if let Some ( i) = min_from_extern {
463- i
464- } else {
465- min_default
466- } ;
462+ let at_least = min_from_extern. unwrap_or ( min_default) ;
467463
468464 // If there are no negative values, we can use the unsigned fit.
469465 if min >= 0 {
@@ -571,13 +567,11 @@ impl<'a, 'gcx, 'tcx> Struct {
571567 if can_optimize {
572568 // This exhaustive match makes new reprs force the adder to modify this function.
573569 // Otherwise, things can silently break.
574- // Note the inversion, return true to stop matching .
570+ // Note the inversion, return true to stop optimizing .
575571 can_optimize = !reprs. iter ( ) . any ( |r| {
576572 match * r {
577- attr:: ReprAny => false ,
578- attr:: ReprInt ( _) => false ,
579- attr:: ReprExtern => true ,
580- attr:: ReprPacked => true ,
573+ attr:: ReprAny | attr:: ReprInt ( _) => false ,
574+ attr:: ReprExtern | attr:: ReprPacked => true ,
581575 attr:: ReprSimd => bug ! ( "Simd vectors should be represented as layout::Vector" )
582576 }
583577 } ) ;
@@ -588,7 +582,7 @@ impl<'a, 'gcx, 'tcx> Struct {
588582 StructKind :: MaybeUnsizedUnivariant => ( can_optimize, false ) ,
589583 StructKind :: EnumVariant => {
590584 assert ! ( fields. len( ) >= 1 , "Enum variants must have discriminants." ) ;
591- ( can_optimize || fields[ 0 ] . size ( dl) . bytes ( ) == 1 , true )
585+ ( can_optimize && fields[ 0 ] . size ( dl) . bytes ( ) == 1 , true )
592586 }
593587 } ;
594588
@@ -1189,7 +1183,7 @@ impl<'a, 'gcx, 'tcx> Layout {
11891183 } ) ;
11901184 }
11911185
1192- if !def. is_enum ( ) || def. variants . len ( ) == 1 && hints. len ( ) == 0 {
1186+ if !def. is_enum ( ) || def. variants . len ( ) == 1 && hints. is_empty ( ) {
11931187 // Struct, or union, or univariant enum equivalent to a struct.
11941188 // (Typechecking will reject discriminant-sizing attrs.)
11951189
@@ -1239,7 +1233,7 @@ impl<'a, 'gcx, 'tcx> Layout {
12391233 v. fields . iter ( ) . map ( |field| field. ty ( tcx, substs) ) . collect :: < Vec < _ > > ( )
12401234 } ) . collect :: < Vec < _ > > ( ) ;
12411235
1242- if variants. len ( ) == 2 && hints. len ( ) == 0 {
1236+ if variants. len ( ) == 2 && hints. is_empty ( ) {
12431237 // Nullable pointer optimization
12441238 for discr in 0 ..2 {
12451239 let other_fields = variants[ 1 - discr] . iter ( ) . map ( |ty| {
0 commit comments