File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -1042,30 +1042,18 @@ impl Type {
10421042 }
10431043
10441044 pub fn is_bool ( & self ) -> bool {
1045- match & self . ty . value {
1046- Ty :: Apply ( a_ty) => match a_ty. ctor {
1047- TypeCtor :: Bool => true ,
1048- _ => false ,
1049- } ,
1050- _ => false ,
1051- }
1045+ matches ! ( self . ty. value, Ty :: Apply ( ApplicationTy { ctor: TypeCtor :: Bool , .. } ) )
10521046 }
10531047
10541048 pub fn is_mutable_reference ( & self ) -> bool {
1055- match & self . ty . value {
1056- Ty :: Apply ( a_ty) => match a_ty. ctor {
1057- TypeCtor :: Ref ( Mutability :: Mut ) => true ,
1058- _ => false ,
1059- } ,
1060- _ => false ,
1061- }
1049+ matches ! (
1050+ self . ty. value,
1051+ Ty :: Apply ( ApplicationTy { ctor: TypeCtor :: Ref ( Mutability :: Mut ) , .. } )
1052+ )
10621053 }
10631054
10641055 pub fn is_unknown ( & self ) -> bool {
1065- match & self . ty . value {
1066- Ty :: Unknown => true ,
1067- _ => false ,
1068- }
1056+ matches ! ( self . ty. value, Ty :: Unknown )
10691057 }
10701058
10711059 /// Checks that particular type `ty` implements `std::future::Future`.
You can’t perform that action at this time.
0 commit comments