Unnamed repository; edit this file 'description' to name the repository.
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 `+=`
bors 2022-08-08
parent 79c22d5 · parent e39918f · commit 554f7f8
-rw-r--r--crates/syntax/src/ast/operators.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/syntax/src/ast/operators.rs b/crates/syntax/src/ast/operators.rs
index a687ba0b77..8f7b3fb600 100644
--- a/crates/syntax/src/ast/operators.rs
+++ b/crates/syntax/src/ast/operators.rs
@@ -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(())
}
}