-
Notifications
You must be signed in to change notification settings - Fork 56
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
Closures with complex arguments #138
Comments
Figuring out how to format closures has been driving me slightly bonkers. And vim doesn't have any appreciation for visually indenting the arguments. Treating them as a |
With my format team hat on: I do think we should use block style for closures. I also think we should treat the leading Would someone be up for writing a PR for the style guide? |
The current style can have a disgusting result:
|
I don't think that's consistent with the style guide, or at least I don't know what rule would produce that result. cc @rust-lang/rustfmt |
This is due to a very long standing bug in rustfmt and as Josh noted, does not adhere to the style guide prescriptions for closures |
This issue has been bugging me too. Anyone working on it? I wonder if a separate option should be added (like |
In #35 the discussion was mainly about how we format the body of closures. Currently rustfmt uses visual indent when we need to use multiple lines for closure's arguments:
Since the default indent style in other places is block indent, I was wondering where rustfmt should use it in closure's arguments as well:
Any thoughts?
The text was updated successfully, but these errors were encountered: