Skip to content

Commit b9abe02

Browse files
Darren TsungDarren Tsung
authored andcommitted
Move in_macro check to end of expression since usual case is not inside macro
1 parent 1f36aa5 commit b9abe02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/eq_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl LintPass for EqOp {
5353
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
5454
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
5555
if let ExprBinary(ref op, ref left, ref right) = e.node {
56-
if !in_macro(e.span) && is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
56+
if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) && !in_macro(e.span) {
5757
span_lint(
5858
cx,
5959
EQ_OP,

0 commit comments

Comments
 (0)