clippy: fix collapsible_match lint#1099
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1099 +/- ##
==========================================
- Coverage 94.38% 93.92% -0.47%
==========================================
Files 48 51 +3
Lines 6665 6466 -199
==========================================
- Hits 6291 6073 -218
- Misses 374 393 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I fixed this manually because the Clippy suggestion introduced an error; issue reported: rust-lang/rust-clippy#16860. |
|
Hi there, thanks for this, but oh Clippy... @jswrenn I think we should avoid My guideline for reasonably explicit code would be:
imho we should bring our code to these standards, and - if Clippy complains too loudly - silence this particular lint. |
|
In these cases, we could replace the match with a single if let guard, e.g.: if let Some(old_key) = self.current_key.take() {
if old_key != key {
self.current_key = Some(key);
first_elt = Some(elt);
break;
}
} |
Yes, please go with that. |
b1f0ba1
fix warn-by-default lint in Rust 1.95
https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match