Fix collapsible_if error

This commit is contained in:
Michael Wright 2018-11-04 10:48:24 +02:00
parent 0c1ffc1d1f
commit a3ab512576

View File

@ -186,8 +186,7 @@ fn check_array(cx: &EarlyContext<'_>, expr: &ast::Expr) {
if let ast::ExprKind::Array(ref array) = expr.node {
for element in array {
if let ast::ExprKind::Binary(ref op, ref lhs, _) = element.node {
if has_unary_equivalent(op.node) {
if !differing_macro_contexts(lhs.span, op.span) {
if has_unary_equivalent(op.node) && !differing_macro_contexts(lhs.span, op.span) {
let space_span = lhs.span.between(op.span);
if let Some(space_snippet) = snippet_opt(cx, space_span) {
let lint_span = lhs.span.with_lo(lhs.span.hi());
@ -207,7 +206,6 @@ fn check_array(cx: &EarlyContext<'_>, expr: &ast::Expr) {
}
}
}
}
/// Implementation of the `SUSPICIOUS_ELSE_FORMATTING` lint for consecutive ifs.
fn check_consecutive_ifs(cx: &EarlyContext<'_>, first: &ast::Expr, second: &ast::Expr) {