diff options
| author | Ross Smyth <crs2017@gmail.com> | 2024-02-17 12:43:54 -0500 |
|---|---|---|
| committer | Ross Smyth <crs2017@gmail.com> | 2024-03-06 00:35:19 -0500 |
| commit | c36d5e3280fbb8001a4c506f2c21227156cb3771 (patch) | |
| tree | 96cfd555608782b2542b9af78bec8db4a49cc656 /clippy_lints/src | |
| parent | 0901b9fecf32c7dd84c83c454d30cbce11cbf2ea (diff) | |
Add MatchKind member to the Match expr for pretty printing & fmt
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/redundant_else.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/suspicious_operation_groupings.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/redundant_else.rs b/clippy_lints/src/redundant_else.rs index fb434fb7450..3bdf13dbbea 100644 --- a/clippy_lints/src/redundant_else.rs +++ b/clippy_lints/src/redundant_else.rs @@ -105,7 +105,7 @@ impl<'ast> Visitor<'ast> for BreakVisitor { fn visit_expr(&mut self, expr: &'ast Expr) { self.is_break = match expr.kind { ExprKind::Break(..) | ExprKind::Continue(..) | ExprKind::Ret(..) => true, - ExprKind::Match(_, ref arms) => arms.iter().all(|arm| + ExprKind::Match(_, ref arms, _) => arms.iter().all(|arm| arm.body.is_none() || arm.body.as_deref().is_some_and(|body| self.check_expr(body)) ), ExprKind::If(_, ref then, Some(ref els)) => self.check_block(then) && self.check_expr(els), diff --git a/clippy_lints/src/suspicious_operation_groupings.rs b/clippy_lints/src/suspicious_operation_groupings.rs index 60e9d262e7e..ab1b3043f0c 100644 --- a/clippy_lints/src/suspicious_operation_groupings.rs +++ b/clippy_lints/src/suspicious_operation_groupings.rs @@ -552,7 +552,7 @@ fn ident_difference_expr_with_base_location( | (Gen(_, _, _), Gen(_, _, _)) | (Block(_, _), Block(_, _)) | (Closure(_), Closure(_)) - | (Match(_, _), Match(_, _)) + | (Match(_, _, _), Match(_, _, _)) | (Loop(_, _, _), Loop(_, _, _)) | (ForLoop { .. }, ForLoop { .. }) | (While(_, _, _), While(_, _, _)) |
