@@ -334,7 +334,7 @@ fn strip_non_ident_wrappers(expr: &Expr) -> &Expr {
334
334
let mut output = expr;
335
335
loop {
336
336
output = match & output. kind {
337
- ExprKind :: Paren ( ref inner) | ExprKind :: Unary ( _, ref inner) => inner,
337
+ ExprKind :: Paren ( inner) | ExprKind :: Unary ( _, inner) => inner,
338
338
_ => {
339
339
return output;
340
340
} ,
@@ -348,13 +348,13 @@ fn extract_related_binops(kind: &ExprKind) -> Option<Vec<BinaryOp<'_>>> {
348
348
349
349
fn if_statement_binops ( kind : & ExprKind ) -> Option < Vec < BinaryOp < ' _ > > > {
350
350
match kind {
351
- ExprKind :: If ( ref condition, _, _) => chained_binops ( & condition. kind ) ,
352
- ExprKind :: Paren ( ref e) => if_statement_binops ( & e. kind ) ,
353
- ExprKind :: Block ( ref block, _) => {
351
+ ExprKind :: If ( condition, _, _) => chained_binops ( & condition. kind ) ,
352
+ ExprKind :: Paren ( e) => if_statement_binops ( & e. kind ) ,
353
+ ExprKind :: Block ( block, _) => {
354
354
let mut output = None ;
355
355
for stmt in & block. stmts {
356
- match stmt. kind {
357
- StmtKind :: Expr ( ref e) | StmtKind :: Semi ( ref e) => {
356
+ match & stmt. kind {
357
+ StmtKind :: Expr ( e) | StmtKind :: Semi ( e) => {
358
358
output = append_opt_vecs ( output, if_statement_binops ( & e. kind ) ) ;
359
359
} ,
360
360
_ => { } ,
@@ -383,24 +383,22 @@ fn append_opt_vecs<A>(target_opt: Option<Vec<A>>, source_opt: Option<Vec<A>>) ->
383
383
fn chained_binops ( kind : & ExprKind ) -> Option < Vec < BinaryOp < ' _ > > > {
384
384
match kind {
385
385
ExprKind :: Binary ( _, left_outer, right_outer) => chained_binops_helper ( left_outer, right_outer) ,
386
- ExprKind :: Paren ( ref e) | ExprKind :: Unary ( _, ref e) => chained_binops ( & e. kind ) ,
386
+ ExprKind :: Paren ( e) | ExprKind :: Unary ( _, e) => chained_binops ( & e. kind ) ,
387
387
_ => None ,
388
388
}
389
389
}
390
390
391
391
fn chained_binops_helper < ' expr > ( left_outer : & ' expr Expr , right_outer : & ' expr Expr ) -> Option < Vec < BinaryOp < ' expr > > > {
392
392
match ( & left_outer. kind , & right_outer. kind ) {
393
393
(
394
- ExprKind :: Paren ( ref left_e) | ExprKind :: Unary ( _, ref left_e) ,
395
- ExprKind :: Paren ( ref right_e) | ExprKind :: Unary ( _, ref right_e) ,
394
+ ExprKind :: Paren ( left_e) | ExprKind :: Unary ( _, left_e) ,
395
+ ExprKind :: Paren ( right_e) | ExprKind :: Unary ( _, right_e) ,
396
396
) => chained_binops_helper ( left_e, right_e) ,
397
- ( ExprKind :: Paren ( ref left_e) | ExprKind :: Unary ( _, ref left_e) , _) => chained_binops_helper ( left_e, right_outer) ,
398
- ( _, ExprKind :: Paren ( ref right_e) | ExprKind :: Unary ( _, ref right_e) ) => {
399
- chained_binops_helper ( left_outer, right_e)
400
- } ,
397
+ ( ExprKind :: Paren ( left_e) | ExprKind :: Unary ( _, left_e) , _) => chained_binops_helper ( left_e, right_outer) ,
398
+ ( _, ExprKind :: Paren ( right_e) | ExprKind :: Unary ( _, right_e) ) => chained_binops_helper ( left_outer, right_e) ,
401
399
(
402
- ExprKind :: Binary ( Spanned { node : left_op, .. } , ref left_left, ref left_right) ,
403
- ExprKind :: Binary ( Spanned { node : right_op, .. } , ref right_left, ref right_right) ,
400
+ ExprKind :: Binary ( Spanned { node : left_op, .. } , left_left, left_right) ,
401
+ ExprKind :: Binary ( Spanned { node : right_op, .. } , right_left, right_right) ,
404
402
) => match (
405
403
chained_binops_helper ( left_left, left_right) ,
406
404
chained_binops_helper ( right_left, right_right) ,
0 commit comments