We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_integer_literal
2 parents 6e33489 + 9147a36 commit ee4390fCopy full SHA for ee4390f
clippy_lints/src/manual_is_power_of_two.rs
@@ -70,12 +70,12 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsPowerOfTwo {
70
if !expr.span.from_expansion()
71
&& let Some((lhs, rhs)) = unexpanded_binop_operands(expr, BinOpKind::Eq)
72
{
73
- if let Some(a) = count_ones_receiver(cx, lhs)
74
- && is_integer_literal(rhs, 1)
+ if is_integer_literal(rhs, 1)
+ && let Some(a) = count_ones_receiver(cx, lhs)
75
76
self.build_sugg(cx, expr, a);
77
- } else if let Some(a) = count_ones_receiver(cx, rhs)
78
- && is_integer_literal(lhs, 1)
+ } else if is_integer_literal(lhs, 1)
+ && let Some(a) = count_ones_receiver(cx, rhs)
79
80
81
} else if is_integer_literal(rhs, 0)
0 commit comments