Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed May 24, 2019
1 parent 07b484c commit c67d2b1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions clippy_lints/src/utils/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ impl<'a> Sugg<'a> {
| ast::ExprKind::Closure(..)
| ast::ExprKind::If(..)
| ast::ExprKind::IfLet(..)
| ast::ExprKind::ObsoleteInPlace(..)
| ast::ExprKind::Unary(..)
| ast::ExprKind::Match(..) => Sugg::MaybeParen(snippet),
ast::ExprKind::Async(..)
Expand Down Expand Up @@ -385,7 +384,6 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static>
rhs
),
AssocOp::Assign => format!("{} = {}", lhs, rhs),
AssocOp::ObsoleteInPlace => format!("in ({}) {}", lhs, rhs),
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, token_to_string(&token::BinOp(op)), rhs),
AssocOp::As => format!("{} as {}", lhs, rhs),
AssocOp::DotDot => format!("{}..{}", lhs, rhs),
Expand Down Expand Up @@ -425,7 +423,7 @@ fn associativity(op: &AssocOp) -> Associativity {
use syntax::util::parser::AssocOp::*;

match *op {
ObsoleteInPlace | Assign | AssignOp(_) => Associativity::Right,
Assign | AssignOp(_) => Associativity::Right,
Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | Colon => Associativity::Both,
Divide | Equal | Greater | GreaterEqual | Less | LessEqual | Modulus | NotEqual | ShiftLeft | ShiftRight
| Subtract => Associativity::Left,
Expand Down

0 comments on commit c67d2b1

Please sign in to comment.