Auto merge of #12974 - fprasx:master, r=lnicola

Corrected order of printing op and `=`

Fixes https://github.com/rust-lang/rust-analyzer/issues/12971 where `Display` impl for assignment operators does `=+` instead of `+=`
This commit is contained in:
bors 2022-08-08 15:13:20 +00:00
commit 554f7f889e

View file

@ -111,10 +111,10 @@ impl fmt::Display for BinaryOp {
BinaryOp::ArithOp(op) => fmt::Display::fmt(op, f),
BinaryOp::CmpOp(op) => fmt::Display::fmt(op, f),
BinaryOp::Assignment { op } => {
f.write_str("=")?;
if let Some(op) = op {
fmt::Display::fmt(op, f)?;
}
f.write_str("=")?;
Ok(())
}
}