Skip to content

Commit

Permalink
Auto merge of rust-lang#12974 - fprasx:master, r=lnicola
Browse files Browse the repository at this point in the history
Corrected order of printing op and `=`

Fixes rust-lang/rust-analyzer#12971 where `Display` impl for assignment operators does `=+` instead of `+=`
  • Loading branch information
bors committed Aug 8, 2022
2 parents 79c22d5 + e39918f commit 554f7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/syntax/src/ast/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
}
Expand Down

0 comments on commit 554f7f8

Please sign in to comment.