Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/hir/intravisit.rs
Outdated
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.
src/librustc/hir/print.rs
Outdated
There was a problem hiding this comment.
I'd keep this the old way too. It's good to see all the options listed.
src/librustc/hir/print.rs
Outdated
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.
|
Thanks for the PR, @ljedrz! I've lot some comments in the code. |
|
@michaelwoerister thanks, comments addressed. |
|
📌 Commit 2919ecd has been approved by |
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
|
☀️ 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