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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
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(())
}
}