Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect display implementation for assignment operators #12971

Closed
atynagano opened this issue Aug 8, 2022 · 3 comments · Fixed by #12974
Closed

Incorrect display implementation for assignment operators #12971

atynagano opened this issue Aug 8, 2022 · 3 comments · Fixed by #12974
Assignees

Comments

@atynagano
Copy link

atynagano commented Aug 8, 2022

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(()) 
 } 
@lnicola
Copy link
Member

lnicola commented Aug 8, 2022

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

@atynagano
Copy link
Author

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

@fprasx
Copy link
Contributor

fprasx commented Aug 8, 2022

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants