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 don't know if this was already reported, but I observe the following behavior:
If I have comments on the same line as opening or closing curly braces (nothing one usually does, I know), the code gets reformatted as follows.
// ...}else{/* some comment, either this style or '//' */// ...
becomes:
// ...}else{/* the comment ends up on the next line! */// ...
My use-case is running code through a post-processor that needs comments to be on a line with the braces, so I would really, really appreciate an option to turn this behavior off. Thanks for considering this request!
The text was updated successfully, but these errors were encountered:
@nokola what version of rustfmt are you using? with the latest version of rustfmt on master the comments are now left on the same line in both your snippet and the snippet from @DanielSchuette in the OP.
I forget exactly which version of rustfmt would contain the fix as there have been quite a few comment-related PRs over the last several weeks
Oops! I was using the litteral snippets above and the same-line comments are not moved on empty blocks. This is still reproducible with non-emtpy blocks, though I believe this is a duplicate of #3255
I don't know if this was already reported, but I observe the following behavior:
If I have comments on the same line as opening or closing curly braces (nothing one usually does, I know), the code gets reformatted as follows.
becomes:
My use-case is running code through a post-processor that needs comments to be on a line with the braces, so I would really, really appreciate an option to turn this behavior off. Thanks for considering this request!
The text was updated successfully, but these errors were encountered: