]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/thir/pattern/_match.rs
Auto merge of #78553 - Nadrieril:fix-78549, r=varkor
[rust.git] / compiler / rustc_mir_build / src / thir / pattern / _match.rs
index 4bbbf416bec4e176139fb1fad3ab8aeff94bd6c4..e0de1351ac33ef1d26f40b47b5d0291022c0f645 100644 (file)
@@ -351,10 +351,7 @@ fn fold_pattern(&mut self, pat: &Pat<'tcx>) -> Pat<'tcx> {
 
 impl<'tcx> Pat<'tcx> {
     pub(super) fn is_wildcard(&self) -> bool {
-        match *self.kind {
-            PatKind::Binding { subpattern: None, .. } | PatKind::Wild => true,
-            _ => false,
-        }
+        matches!(*self.kind, PatKind::Binding { subpattern: None, .. } | PatKind::Wild)
     }
 }
 
@@ -1380,10 +1377,7 @@ fn new_useful(preference: WitnessPreference) -> Self {
     }
 
     fn is_useful(&self) -> bool {
-        match *self {
-            NotUseful => false,
-            _ => true,
-        }
+        !matches!(*self, NotUseful)
     }
 
     fn apply_constructor<'p>(
@@ -1644,10 +1638,7 @@ struct IntRange<'tcx> {
 impl<'tcx> IntRange<'tcx> {
     #[inline]
     fn is_integral(ty: Ty<'_>) -> bool {
-        match ty.kind() {
-            ty::Char | ty::Int(_) | ty::Uint(_) | ty::Bool => true,
-            _ => false,
-        }
+        matches!(ty.kind(), ty::Char | ty::Int(_) | ty::Uint(_) | ty::Bool)
     }
 
     fn is_singleton(&self) -> bool {