]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/loops.rs
fix match_like_matches_macro in clippy
[rust.git] / clippy_lints / src / loops.rs
index b803d753b6d0474c9d17b28e910ca610816dd5ab..396bb6591090321e80c534f2903f68d88b4b3b69 100644 (file)
@@ -2091,17 +2091,11 @@ fn var_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<HirId> {
 }
 
 fn is_loop(expr: &Expr<'_>) -> bool {
-    match expr.kind {
-        ExprKind::Loop(..) => true,
-        _ => false,
-    }
+    matches!(expr.kind, ExprKind::Loop(..))
 }
 
 fn is_conditional(expr: &Expr<'_>) -> bool {
-    match expr.kind {
-        ExprKind::Match(..) => true,
-        _ => false,
-    }
+    matches!(expr.kind, ExprKind::Match(..))
 }
 
 fn is_nested(cx: &LateContext<'_>, match_expr: &Expr<'_>, iter_expr: &Expr<'_>) -> bool {