@@ -54,38 +54,26 @@ impl NamedEntityKind {
5454 }
5555
5656 pub fn is_deferred_constant ( & self ) -> bool {
57- if let NamedEntityKind :: DeferredConstant = self {
58- true
59- } else {
60- false
61- }
57+ matches ! ( self , NamedEntityKind :: DeferredConstant )
6258 }
6359
6460 pub fn is_non_deferred_constant ( & self ) -> bool {
65- if let NamedEntityKind :: Object ( ObjectClass :: Constant ) = self {
66- true
67- } else {
68- false
69- }
61+ matches ! ( self , NamedEntityKind :: Object ( ObjectClass :: Constant ) )
7062 }
7163
7264 pub fn is_protected_type ( & self ) -> bool {
73- if let NamedEntityKind :: ProtectedType ( ..) = self {
74- true
75- } else {
76- false
77- }
65+ matches ! ( self , NamedEntityKind :: ProtectedType ( ..) )
7866 }
7967
8068 pub fn is_type ( & self ) -> bool {
81- match self {
69+ matches ! (
70+ self ,
8271 NamedEntityKind :: IncompleteType
83- | NamedEntityKind :: ProtectedType ( ..)
84- | NamedEntityKind :: InterfaceType
85- | NamedEntityKind :: Subtype ( ..)
86- | NamedEntityKind :: TypeDeclaration ( ..) => true ,
87- _ => false ,
88- }
72+ | NamedEntityKind :: ProtectedType ( ..)
73+ | NamedEntityKind :: InterfaceType
74+ | NamedEntityKind :: Subtype ( ..)
75+ | NamedEntityKind :: TypeDeclaration ( ..)
76+ )
8977 }
9078
9179 pub fn implicit_declarations ( & self ) -> Vec < Arc < NamedEntity > > {
@@ -180,10 +168,10 @@ pub struct ParameterList {
180168
181169impl ParameterList {
182170 pub fn add_param ( & mut self , param : Arc < NamedEntity > ) {
183- debug_assert ! ( match param . kind ( ) {
184- NamedEntityKind :: InterfaceObject ( .. ) | NamedEntityKind :: InterfaceFile ( .. ) => true ,
185- _ => false ,
186- } ) ;
171+ debug_assert ! ( matches! (
172+ param . kind ( ) ,
173+ NamedEntityKind :: InterfaceObject ( .. ) | NamedEntityKind :: InterfaceFile ( .. )
174+ ) ) ;
187175
188176 self . params . push ( param) ;
189177 }
@@ -364,19 +352,11 @@ impl NamedEntity {
364352 }
365353
366354 pub fn is_subprogram ( & self ) -> bool {
367- if let NamedEntityKind :: Subprogram ( ..) = self . kind {
368- true
369- } else {
370- false
371- }
355+ matches ! ( self . kind, NamedEntityKind :: Subprogram ( ..) )
372356 }
373357
374358 pub fn is_subprogram_decl ( & self ) -> bool {
375- if let NamedEntityKind :: SubprogramDecl ( ..) = self . kind {
376- true
377- } else {
378- false
379- }
359+ matches ! ( self . kind, NamedEntityKind :: SubprogramDecl ( ..) )
380360 }
381361
382362 pub fn is_explicit ( & self ) -> bool {
0 commit comments