Skip to content

Incorrect display implementation for assignment operators #12971

@atynagano

Description

@atynagano

BinaryOp::Assignment { op } => {
f.write_str("=")?;
if let Some(op) = op {
fmt::Display::fmt(op, f)?;
}
Ok(())
}

Isn't the order reversed?

 BinaryOp::Assignment { op } => { 
     if let Some(op) = op { 
         fmt::Display::fmt(op, f)?; 
     } 
     f.write_str("=")?; 
     Ok(()) 
 } 

Activity

lnicola

lnicola commented on Aug 8, 2022

@lnicola
Member

I think so. Do you want to file a PR?

atynagano

atynagano commented on Aug 8, 2022

@atynagano
Author

I don't know how to do it. If you can, I'll leave it to you.

fprasx

fprasx commented on Aug 8, 2022

@fprasx
Contributor

@rustbot claim

added a commit that references this issue on Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @lnicola@atynagano@fprasx

    Issue actions

      Incorrect display implementation for assignment operators · Issue #12971 · rust-lang/rust-analyzer