-
Notifications
You must be signed in to change notification settings - Fork 917
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
rustfmt gives up on entire closure if it contains a long string #5528
Comments
Setting
|
I'm closing as a duplicate of #3863. The closure is a red herring; it's the |
From #3863 (comment):
|
I'm sure this is a variation on many previous issues, but it is also a little different and worse (in my humble opinion).
If we have a long string in a structure, that structure is not formatted: #4800
If we have a long string in a chain of function calls, that chain is not formatted: #3863
However, if we have a long string somewhere in a closure, the entire closure is not formatted! This is a much worse user experience, and does not give any errors by default to even guide why rustfmt fails.
I took the example from #4800 and wrapped it in a closure. rustfmt does nothing and doesn't complain either:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1193f5482e94bfbdfbdb6a5a0c93866b
The text was updated successfully, but these errors were encountered: