-
Notifications
You must be signed in to change notification settings - Fork 896
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
Empty match arms #4065
Comments
I took my time trying to write this but I looked at the wrong line instead ( |
@pickfire are you working on this? I would like to contribute. What should be done mainly here? |
@laysauchoa No, I tried checking this but I didn't spend much time on this issue. My guess is somewhere around https://github.com/rust-lang/rustfmt/blob/master/rustfmt-core/rustfmt-lib/src/matches.rs#L219 but I don't quite grasp the workflow of rustfmt yet, I don't quite know how to debug stuff here. |
@laysauchoa take a look at matches#rewrite_match_body. It should be enough to check if the arm body is an empty block, which is resolved here: rustfmt/rustfmt-core/rustfmt-lib/src/matches.rs Lines 360 to 362 in 99edc88
And if so, rewrite the original arm body with rustfmt/rustfmt-core/rustfmt-lib/src/matches.rs Lines 370 to 377 in 99edc88
Or something like that.. |
=> ()
should be=> {}
rust-lang/style-team#146The text was updated successfully, but these errors were encountered: