@@ -121,7 +121,7 @@ impl LintPass for BitMask {
121
121
122
122
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for BitMask {
123
123
fn check_expr ( & mut self , cx : & LateContext < ' a , ' tcx > , e : & ' tcx Expr ) {
124
- if let ExprKind :: Binary ( ref cmp, ref left, ref right) = e. node {
124
+ if let ExprKind :: Binary ( cmp, left, right) = & e. node {
125
125
if cmp. node . is_comparison ( ) {
126
126
if let Some ( cmp_opt) = fetch_int_literal ( cx, right) {
127
127
check_compare ( cx, left, cmp. node , cmp_opt, e. span )
@@ -131,13 +131,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
131
131
}
132
132
}
133
133
if_chain ! {
134
- if let ExprKind :: Binary ( ref op, ref left, ref right) = e. node;
134
+ if let ExprKind :: Binary ( op, left, right) = & e. node;
135
135
if BinOpKind :: Eq == op. node;
136
- if let ExprKind :: Binary ( ref op1, ref left1, ref right1) = left. node;
136
+ if let ExprKind :: Binary ( op1, left1, right1) = & left. node;
137
137
if BinOpKind :: BitAnd == op1. node;
138
- if let ExprKind :: Lit ( ref lit) = right1. node;
138
+ if let ExprKind :: Lit ( lit) = & right1. node;
139
139
if let LitKind :: Int ( n, _) = lit. node;
140
- if let ExprKind :: Lit ( ref lit1) = right. node;
140
+ if let ExprKind :: Lit ( lit1) = & right. node;
141
141
if let LitKind :: Int ( 0 , _) = lit1. node;
142
142
if n. leading_zeros( ) == n. count_zeros( ) ;
143
143
if n > u128 :: from( self . verbose_bit_mask_threshold) ;
@@ -173,7 +173,7 @@ fn invert_cmp(cmp: BinOpKind) -> BinOpKind {
173
173
}
174
174
175
175
fn check_compare ( cx : & LateContext < ' _ , ' _ > , bit_op : & Expr , cmp_op : BinOpKind , cmp_value : u128 , span : Span ) {
176
- if let ExprKind :: Binary ( ref op, ref left, ref right) = bit_op. node {
176
+ if let ExprKind :: Binary ( op, left, right) = & bit_op. node {
177
177
if op. node != BinOpKind :: BitAnd && op. node != BinOpKind :: BitOr {
178
178
return ;
179
179
}
0 commit comments