Skip to content

Commit 13c857b

Browse files
committed
Use match ergonomics for block_in_if_condition lint
1 parent fe151eb commit 13c857b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/block_in_if_condition.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ const COMPLEX_BLOCK_MESSAGE: &str = "in an 'if' condition, avoid complex blocks
8888

8989
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
9090
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
91-
if let ExprKind::If(ref check, ref then, _) = expr.node {
92-
if let ExprKind::Block(ref block, _) = check.node {
91+
if let ExprKind::If(check, then, _) = &expr.node {
92+
if let ExprKind::Block(block, _) = &check.node {
9393
if block.rules == DefaultBlock {
9494
if block.stmts.is_empty() {
95-
if let Some(ref ex) = block.expr {
95+
if let Some(ex) = &block.expr {
9696
// don't dig into the expression here, just suggest that they remove
9797
// the block
9898
if in_macro(expr.span) || differing_macro_contexts(expr.span, ex.span) {

0 commit comments

Comments
 (0)