You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes write enums with a comment at the end saying something like "I should add foo in the future". Like
enumMyEnum{Bar,// I should add Foo}
Unfortunately, rustfmt thinks it would be wise to reformat this into
enumMyEnum{Bar,// I should add Foo}
Even worse, when enabling trailing_comma = "Never", I get the non-idempotent output where first it looks like above without the trailing comma, and then gets moved even further up:
enumMyEnum{Bar// I should add Foo}
That formatting is very far from my original intention when writing code, and actively hinders readability as one might now ask why the comment should be related to that last enum variant. I think the behaviour should be changed so that rustfmt leaves the trailing comment with an empty newline as it is.
The text was updated successfully, but these errors were encountered:
I sometimes write enums with a comment at the end saying something like "I should add foo in the future". Like
Unfortunately, rustfmt thinks it would be wise to reformat this into
Even worse, when enabling
trailing_comma = "Never"
, I get the non-idempotent output where first it looks like above without the trailing comma, and then gets moved even further up:That formatting is very far from my original intention when writing code, and actively hinders readability as one might now ask why the comment should be related to that last enum variant. I think the behaviour should be changed so that rustfmt leaves the trailing comment with an empty newline as it is.
The text was updated successfully, but these errors were encountered: