chore: fix clippy::single_match_else#10699
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 |
|
@sylvestre we use squash merge now? |
|
isn't it usually better? Otherwise all the minor iterations of the code end up in history, making it much less useful |
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.