]> git.lizzy.rs Git - rust.git/commitdiff
Fix dogfood tests
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 28 Apr 2017 16:13:09 +0000 (18:13 +0200)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 28 Apr 2017 16:13:09 +0000 (18:13 +0200)
clippy_lints/src/eq_op.rs

index 51a11dd9dde65b90d0ddb3a7176783b37ebfce0c..6dedbe4b673e075b17f565af2b9528c4af7c7f1c 100644 (file)
@@ -52,14 +52,12 @@ fn get_lints(&self) -> LintArray {
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
     fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprBinary(ref op, ref left, ref right) = e.node {
-            if is_valid_operator(op) {
-                if SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
-                    span_lint(cx,
-                              EQ_OP,
-                              e.span,
-                              &format!("equal expressions as operands to `{}`", op.node.as_str()));
-                    return;
-                }
+            if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
+                span_lint(cx,
+                            EQ_OP,
+                            e.span,
+                            &format!("equal expressions as operands to `{}`", op.node.as_str()));
+                return;
             }
             let (trait_id, requires_ref) = match op.node {
                 BiAdd => (cx.tcx.lang_items.add_trait(), false),