Parse a pattern with no arm

This commit is contained in:
Nadrieril
2023-11-27 03:15:56 +01:00
parent caa488b96e
commit 80bdcbf50a
36 changed files with 420 additions and 279 deletions

View File

@@ -1113,15 +1113,17 @@ impl EarlyLintPass for UnusedParens {
}
ExprKind::Match(ref _expr, ref arm) => {
for a in arm {
self.check_unused_delims_expr(
cx,
&a.body,
UnusedDelimsCtx::MatchArmExpr,
false,
None,
None,
true,
);
if let Some(body) = &a.body {
self.check_unused_delims_expr(
cx,
body,
UnusedDelimsCtx::MatchArmExpr,
false,
None,
None,
true,
);
}
}
}
_ => {}