From a9e1b1fba05ce94a65f511e2c07bd086c1b0f00f Mon Sep 17 00:00:00 2001 From: mcarton Date: Sun, 7 Feb 2016 14:40:45 +0100 Subject: [PATCH] Small cleanup --- src/copies.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/copies.rs b/src/copies.rs index 84324dffc859..525c7b7a6fde 100644 --- a/src/copies.rs +++ b/src/copies.rs @@ -54,15 +54,10 @@ impl LateLintPass for CopyAndPaste { /// Implementation of `IF_SAME_THEN_ELSE`. fn lint_same_then_else(cx: &LateContext, expr: &Expr) { if let ExprIf(_, ref then_block, Some(ref else_expr)) = expr.node { - let must_lint = if let ExprBlock(ref else_block) = else_expr.node { - is_block_equal(cx, &then_block, &else_block, false) - } - else { - false - }; - - if must_lint { - span_lint(cx, IF_SAME_THEN_ELSE, expr.span, "this if has the same then and else blocks"); + if let ExprBlock(ref else_block) = else_expr.node { + if is_block_equal(cx, &then_block, &else_block, false) { + span_lint(cx, IF_SAME_THEN_ELSE, expr.span, "this if has the same then and else blocks"); + } } } }