-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
chore: use let-else
anywhere possible and practical
#10742
base: master
Are you sure you want to change the base?
chore: use let-else
anywhere possible and practical
#10742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of refactor is good when you're already rewriting a block in a PR but converting everything will just make a bunch of conflicts for open PRs - only for a cosmetic benefit
It's only a few lines where looking at the reason for the diff makes it a very very easy conflict to fix, I think the refacto is worth it. What's more, I don't think the parts I touched are modified all that often, else they would probably have been caught in the 13 versions of Rust since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this change, it mostly changes small blocks that were a standalone expression (something or early return/error)
The conflicts are easy, it's just making work for anyone with a branch that touches any of this code and for no practical benefit: it's purely cosmetic. I don't feel super strongly about this so I've removed my red 'X' and anyone can free to merge this but my opinion is that I'd rather see this closed than merged. |
I would be ok with some touchups to the DAP code since we genuinely never touch that. For moster other code change here there are open PRs (or stuff in the works that doesn't yet have a PR) that touches that. I think I agree with Mike here that touchupsnlike this aren't worth it when they cause conflicts. They may seem minor but they do definitly add up a lot. I already spent a lot of time conflict resolving. Even if most conflicts are minor just going trough all of them takes time. Especially because you need to read conflicts very carefully to missing subtle changes. For example after this PR somebody else may fix a off by one error. If I would just scan a conflict and just see "this is a let ... else change" and then change the new code to also let else I wouldnlikely miss the mor subtle fix (something like this has happened to me before but I thankfully caught it myself since it caused a noticeable regression but thay isn't always the case). |
5b46119
to
33a3f46
Compare
33a3f46
to
a20fb7e
Compare
Drive-by MR to shorten lots of simples
match
es, removing code to read is nice