What's the rationale behind forbidding comments after an open bracket? #6502
Answered by ytmimi
rodrigocfd asked this question in Q&A
-
| I'm really struggling with this: if foo { // my comment }...being formatted to: if foo { // my comment }Why? |
Beta Was this translation helpful? Give feedback.
Answered by ytmimi Mar 12, 2025
Replies: 1 comment 1 reply
-
| To be honest, I don't have a good answer for you. As long as I've been a member of the rustfmt team that's been the behavior. It might be that there was an intentional reason for this, but I don't have that context. It could also just be the result of how the formatting was implemented. For your reference there's an open issues for this #3255. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by rodrigocfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
To be honest, I don't have a good answer for you. As long as I've been a member of the rustfmt team that's been the behavior. It might be that there was an intentional reason for this, but I don't have that context. It could also just be the result of how the formatting was implemented. For your reference there's an open issues for this #3255.