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 {
1042
1042
}
1043
1043
1044
1044
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 , .. } ) )
1052
1046
}
1053
1047
1054
1048
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
+ )
1062
1053
}
1063
1054
1064
1055
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 )
1069
1057
}
1070
1058
1071
1059
/// Checks that particular type `ty` implements `std::future::Future`.
You can’t perform that action at this time.
0 commit comments