-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: fix clippy::single_match_else
#10699
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
Conversation
|
GNU testsuite comparison: |
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
|
is it always better ? :) |
|
hard to say - I'm sure we can come up with some case when its not - but I looked through every case fixed here - seems to all make sense and all make code easier to read, less indented, and shorter overall - so I guess that lint does have some value :) |
I've avoided fixing this lint so far because it seems like a lot of churn, and in a lot of cases the code could be refactored in a more idiomatic way. |
|
are there any examples where you think the code could be improved even better? I reviewed each case by hand, extensively - unless i missed something, they all made sense to me. I agree it is a bit of churn - but it results in more readable shorter code as the result |
after removing
single_match_else = "allow"I ran this command:and manually fixed all the edge cases and restored some comments to the new location. No AI here :)
Overall, now the code is less nested, shorter, and cleaner to reason about. When reviewing, make sure to hide whitespace in the ⚙️ menu.