Skip to content

Closing brace in {} can be separated #4098

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

Closed
varkor opened this issue Mar 26, 2020 · 3 comments
Closed

Closing brace in {} can be separated #4098

varkor opened this issue Mar 26, 2020 · 3 comments

Comments

@varkor
Copy link
Member

varkor commented Mar 26, 2020

See here, for instance, where rustfmt decided that

                (AngleBracketedArg::Arg(_), None) | (AngleBracketedArg::Constraint(_), Some(_)) => {
                }

was ideal. This looks silly — {} (and any other paired symbols) should be kept together.

@topecongiro
Copy link
Contributor

Thank you for the report. However this is expected, { is the 100th character on the line, and putting } on the same line will exceed the max width.

@varkor
Copy link
Member Author

varkor commented Mar 31, 2020

I understand why it happens. However, I think this behaviour is wrong: according to the formatting RFC, empty blocks should be written {}: https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/expressions.md#blocks. The current behaviour is also ugly.

@varkor
Copy link
Member Author

varkor commented Apr 7, 2020

cc @topecongiro: I think this should be reopened following #4098 (comment).

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

No branches or pull requests

2 participants