-
Notifications
You must be signed in to change notification settings - Fork 927
Strange formatting for closure with match #1395
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
Comments
I wonder if this is just another manifestation of #1332... |
#1405 could be the the same thing? |
@aldanor in fact, I think these are all the result of the new visual indent rules for closures (in #1332). If you look at these cases, rustfmt does "the right thing" for all of them, in the sense of choosing to use visual indent for the closure body, and then block closure for some things inside the closure body. The bug seems to be that block indent inside a visual indent does not inherit the indentation level of the containing visual indent. |
With the RFC style, this is currently formatted as:
Which is much better, but not quite perfect. |
Better indeed. However In the original example, closure body was surrounded by braces -- were they removed by |
Yes |
Closed by #1454. |
Take the following (manually formatted) code:
rustfmt
will currently turn that intoWhich is much less visually clear. It almost seems like
rustfmt
forgets to carry along the indentation level?The text was updated successfully, but these errors were encountered: