Uh oh!
There was an error while loading. Please reload this page.
A few cleanups for hir - #54151
Conversation
rust-highfive
commented
Sep 12, 2018
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Usually we try to make match statements exhaustive in order to catch errors when new variants are added.
There was a problem hiding this comment.
I'd keep this the old way too. It's good to see all the options listed.
There was a problem hiding this comment.
The same here and constness above. It's a bit more verbose to list all variants, but also a lot more readable for someone who does not know the code base by heart.
michaelwoerister
commented
Sep 12, 2018
Thanks for the PR, @ljedrz! I've lot some comments in the code. |
ljedrz
commented
Sep 12, 2018
@michaelwoerister thanks, comments addressed. |
ljedrz
commented
Sep 14, 2018
michaelwoerister
commented
Sep 14, 2018
bors
commented
Sep 14, 2018
📌 Commit 2919ecd has been approved by |
bors
commented
Sep 15, 2018
A few cleanups for hir - prefer `if let` to `match` when only 1 branch matters - `chain` iterable items that are looped over in sequence - `sort_by_key` instead of `sort_by` when possible - change cloning `map`s to `cloned()` - use `unwrap_or_else` and `ok` when applicable - a few other minor readability improvements - whitespace fixes
bors
commented
Sep 15, 2018
☀️ Test successful - status-appveyor, status-travis |
if lettomatchwhen only 1 branch matterschainiterable items that are looped over in sequencesort_by_keyinstead ofsort_bywhen possiblemaps tocloned()unwrap_or_elseandokwhen applicable