Skip to content

Commit

Permalink
Use token_to_string instead of binop_to_string
Browse files Browse the repository at this point in the history
Fixes #1887
  • Loading branch information
Matt Kraai committed Jul 13, 2017
1 parent e80d883 commit 7131fda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/utils/sugg.rs
Expand Up @@ -8,7 +8,8 @@ use std::borrow::Cow;
use std::fmt::Display;
use std;
use syntax::codemap::{CharPos, Span};
use syntax::print::pprust::binop_to_string;
use syntax::parse::token;
use syntax::print::pprust::token_to_string;
use syntax::util::parser::AssocOp;
use syntax::ast;
use utils::{higher, snippet, snippet_opt};
Expand Down Expand Up @@ -287,7 +288,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg, rhs: &Sugg) -> Sugg<'static> {
},
AssocOp::Inplace => format!("in ({}) {}", lhs, rhs),
AssocOp::Assign => format!("{} = {}", lhs, rhs),
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, binop_to_string(op), rhs),
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, token_to_string(&token::BinOp(op)), rhs),
AssocOp::As => format!("{} as {}", lhs, rhs),
AssocOp::DotDot => format!("{}..{}", lhs, rhs),
AssocOp::DotDotDot => format!("{}...{}", lhs, rhs),
Expand Down

0 comments on commit 7131fda

Please sign in to comment.