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

2024 Style Edition Consideration: Consistency in breaks around assignment operator #179

Open
calebcartwright opened this issue Apr 5, 2023 · 0 comments

Comments

@calebcartwright
Copy link
Member

The Style Guide currently has differing guidance around whether to break before or after the assignment operator depending on whether the construct is a let statement (after) or a control flow expression (before)

rustfmt current behavior is thus a bug, in that rustfmt breaks after the operator even for control flow expressions. Regardless of what the guidance ends up being in the 2024 Style Edition, rustfmt's defaults will be sure to match.

However, the discover of this not-following-style-guide-by-default bug in rustfmt triggered some subsequent discussion that made it apparent t-style should at least consider potentially making an update as part of the 2024 Style Edition in an effort to be consistent (i.e. should the break be before the operator in statements as well? or should the break be after the operator in expressions?)

Zulip discussion for reference: https://rust-lang.zulipchat.com/#narrow/stream/346005-t-style/topic/let-else.20formatting.20and.20control.20flow.20expressions

@calebcartwright calebcartwright changed the title 2024 Edition Consideration: Consistency in breaks around assignment operator 2024 Style Edition Consideration: Consistency in breaks around assignment operator Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants