-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
use filter(|x| matches!(..)) instead of filter_map(|x| match x ... => Some(xy)) #90652
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
05d34b5
to
723db0d
Compare
d2a9185
to
ed7e438
Compare
.filter_map(|param| match param.kind { | ||
GenericParamKind::Lifetime { .. } => Some(param), | ||
_ => None, | ||
.filter(|param| { | ||
matches!(param.kind, GenericParamKind::Lifetime { .. }) | ||
}) | ||
.enumerate() | ||
.map(|(late_bound_idx, param)| { |
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.
hrm, apparently rustfmt really prefers
.filter(|param| {
matches!(param.kind, GenericParamKind::Lifetime { .. })
})
over
.filter(|param| matches!(param.kind, GenericParamKind::Lifetime { .. }))
:/
@bors r+ rollup |
📌 Commit ed7e438 has been approved by |
} | ||
} | ||
|
||
Some(field) | ||
return true; |
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.
return true; | |
true |
…yn514 use filter(|x| matches!(..)) instead of filter_map(|x| match x ... => Some(xy))
…yn514 use filter(|x| matches!(..)) instead of filter_map(|x| match x ... => Some(xy))
…laumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#90494 (ARMv6K Horizon OS panic change) - rust-lang#90652 (use filter(|x| matches!(..)) instead of filter_map(|x| match x ... => Some(xy))) - rust-lang#90657 (Fix bug with `#[doc]` string single-character last lines) - rust-lang#90689 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.