@@ -175,11 +175,9 @@ impl Item {
175175 }
176176
177177 crate fn is_crate ( & self ) -> bool {
178- match * self . kind {
178+ matches ! ( * self . kind,
179179 StrippedItem ( box ModuleItem ( Module { is_crate: true , .. } ) )
180- | ModuleItem ( Module { is_crate : true , .. } ) => true ,
181- _ => false ,
182- }
180+ | ModuleItem ( Module { is_crate: true , .. } ) )
183181 }
184182 crate fn is_mod ( & self ) -> bool {
185183 self . type_ ( ) == ItemType :: Module
@@ -378,10 +376,7 @@ impl ItemKind {
378376 }
379377
380378 crate fn is_type_alias ( & self ) -> bool {
381- match * self {
382- ItemKind :: TypedefItem ( _, _) | ItemKind :: AssocTypeItem ( _, _) => true ,
383- _ => false ,
384- }
379+ matches ! ( self , ItemKind :: TypedefItem ( ..) | ItemKind :: AssocTypeItem ( ..) )
385380 }
386381}
387382
@@ -674,7 +669,7 @@ impl Attributes {
674669 span : attr. span ,
675670 doc : contents,
676671 kind : DocFragmentKind :: Include { filename } ,
677- parent_module : parent_module ,
672+ parent_module,
678673 } ) ;
679674 }
680675 }
@@ -750,7 +745,7 @@ impl Attributes {
750745 Some ( did) => {
751746 if let Some ( ( mut href, ..) ) = href ( did) {
752747 if let Some ( ref fragment) = * fragment {
753- href. push_str ( "#" ) ;
748+ href. push ( '#' ) ;
754749 href. push_str ( fragment) ;
755750 }
756751 Some ( RenderedLink {
@@ -945,10 +940,7 @@ crate enum GenericParamDefKind {
945940
946941impl GenericParamDefKind {
947942 crate fn is_type ( & self ) -> bool {
948- match * self {
949- GenericParamDefKind :: Type { .. } => true ,
950- _ => false ,
951- }
943+ matches ! ( self , GenericParamDefKind :: Type { .. } )
952944 }
953945
954946 // FIXME(eddyb) this either returns the default of a type parameter, or the
@@ -1292,15 +1284,12 @@ impl Type {
12921284 }
12931285
12941286 crate fn is_full_generic ( & self ) -> bool {
1295- match * self {
1296- Type :: Generic ( _) => true ,
1297- _ => false ,
1298- }
1287+ matches ! ( self , Type :: Generic ( _) )
12991288 }
13001289
13011290 crate fn projection ( & self ) -> Option < ( & Type , DefId , Symbol ) > {
13021291 let ( self_, trait_, name) = match self {
1303- QPath { ref self_type, ref trait_, name } => ( self_type, trait_, name) ,
1292+ QPath { self_type, trait_, name } => ( self_type, trait_, name) ,
13041293 _ => return None ,
13051294 } ;
13061295 let trait_did = match * * trait_ {
0 commit comments