@@ -325,22 +325,22 @@ pub fn make_unop(op: &str, expr: Sugg<'_>) -> Sugg<'static> {
325325/// parenthesis will always be added for a mix of these.
326326pub fn make_assoc ( op : AssocOp , lhs : & Sugg < ' _ > , rhs : & Sugg < ' _ > ) -> Sugg < ' static > {
327327 /// Returns `true` if the operator is a shift operator `<<` or `>>`.
328- fn is_shift ( op : & AssocOp ) -> bool {
329- matches ! ( * op, AssocOp :: ShiftLeft | AssocOp :: ShiftRight )
328+ fn is_shift ( op : AssocOp ) -> bool {
329+ matches ! ( op, AssocOp :: ShiftLeft | AssocOp :: ShiftRight )
330330 }
331331
332332 /// Returns `true` if the operator is a arithmetic operator
333333 /// (i.e., `+`, `-`, `*`, `/`, `%`).
334- fn is_arith ( op : & AssocOp ) -> bool {
334+ fn is_arith ( op : AssocOp ) -> bool {
335335 matches ! (
336- * op,
336+ op,
337337 AssocOp :: Add | AssocOp :: Subtract | AssocOp :: Multiply | AssocOp :: Divide | AssocOp :: Modulus
338338 )
339339 }
340340
341341 /// Returns `true` if the operator `op` needs parenthesis with the operator
342342 /// `other` in the direction `dir`.
343- fn needs_paren ( op : & AssocOp , other : & AssocOp , dir : Associativity ) -> bool {
343+ fn needs_paren ( op : AssocOp , other : AssocOp , dir : Associativity ) -> bool {
344344 other. precedence ( ) < op. precedence ( )
345345 || ( other. precedence ( ) == op. precedence ( )
346346 && ( ( op != other && associativity ( op) != dir)
@@ -349,14 +349,14 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static>
349349 || is_shift ( other) && is_arith ( op)
350350 }
351351
352- let lhs_paren = if let Sugg :: BinOp ( ref lop, _) = * lhs {
353- needs_paren ( & op, lop, Associativity :: Left )
352+ let lhs_paren = if let Sugg :: BinOp ( lop, _) = * lhs {
353+ needs_paren ( op, lop, Associativity :: Left )
354354 } else {
355355 false
356356 } ;
357357
358- let rhs_paren = if let Sugg :: BinOp ( ref rop, _) = * rhs {
359- needs_paren ( & op, rop, Associativity :: Right )
358+ let rhs_paren = if let Sugg :: BinOp ( rop, _) = * rhs {
359+ needs_paren ( op, rop, Associativity :: Right )
360360 } else {
361361 false
362362 } ;
@@ -424,13 +424,13 @@ enum Associativity {
424424/// they are considered
425425/// associative.
426426#[ must_use]
427- fn associativity ( op : & AssocOp ) -> Associativity {
427+ fn associativity ( op : AssocOp ) -> Associativity {
428428 use rustc_ast:: util:: parser:: AssocOp :: {
429429 Add , As , Assign , AssignOp , BitAnd , BitOr , BitXor , Colon , Divide , DotDot , DotDotEq , Equal , Greater ,
430430 GreaterEqual , LAnd , LOr , Less , LessEqual , Modulus , Multiply , NotEqual , ShiftLeft , ShiftRight , Subtract ,
431431 } ;
432432
433- match * op {
433+ match op {
434434 Assign | AssignOp ( _) => Associativity :: Right ,
435435 Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | Colon => Associativity :: Both ,
436436 Divide | Equal | Greater | GreaterEqual | Less | LessEqual | Modulus | NotEqual | ShiftLeft | ShiftRight
0 commit comments