Skip to content

Commit 7131fda

Browse files
author
Matt Kraai
committed
Use token_to_string instead of binop_to_string
Fixes rust-lang#1887
1 parent e80d883 commit 7131fda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/utils/sugg.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use std::borrow::Cow;
88
use std::fmt::Display;
99
use std;
1010
use syntax::codemap::{CharPos, Span};
11-
use syntax::print::pprust::binop_to_string;
11+
use syntax::parse::token;
12+
use syntax::print::pprust::token_to_string;
1213
use syntax::util::parser::AssocOp;
1314
use syntax::ast;
1415
use utils::{higher, snippet, snippet_opt};
@@ -287,7 +288,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg, rhs: &Sugg) -> Sugg<'static> {
287288
},
288289
AssocOp::Inplace => format!("in ({}) {}", lhs, rhs),
289290
AssocOp::Assign => format!("{} = {}", lhs, rhs),
290-
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, binop_to_string(op), rhs),
291+
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, token_to_string(&token::BinOp(op)), rhs),
291292
AssocOp::As => format!("{} as {}", lhs, rhs),
292293
AssocOp::DotDot => format!("{}..{}", lhs, rhs),
293294
AssocOp::DotDotDot => format!("{}...{}", lhs, rhs),

0 commit comments

Comments
 (0)