-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Change redundant_pattern_matching
to also lint std::task::Poll
#6339
Conversation
r? @ebroto (rust_highfive has picked a reviewer for you, use r? to override) |
6d96043
to
e39c3fe
Compare
Suggest using utility methods `is_pending` and `is_ready`.
e39c3fe
to
5a83968
Compare
@bors r+ Thanks! (and sorry for the delay in reviewing, I did not have much free time lately) |
📌 Commit 5a83968 has been approved by |
Change `redundant_pattern_matching` to also lint `std::task::Poll` `reduntant_pattern_matching` currently lints pattern matching on `Option` and `Result` where the `is_variant` utility methods could be used instead: `is_some`, `is_none`, `is_ok`, `is_err`. This PR extends this behaviour to `std::task::Poll`, suggesting the methods `is_pending` and `is_ready`. Motivation: The current description of `redundant_pattern_matching` mentions > It's more concise and clear to just use the proper utility function which in my mind applies to `Poll` as well.
💔 Test failed - checks-action_test |
@bors retry (changelog) |
If you agree with the similar reasoning I can create a PR to also add |
Yep, sounds good to me! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Enhance `redundant_pattern_matching` to also lint on `std::net::IpAddr` Follow-up to #6339 r? `@ebroto` (note: also contains a small cleanup of the other ui tests) changelog: Enhance [`redundant_pattern_matching`] to also lint on `std::net::IpAddr`
reduntant_pattern_matching
currently lints pattern matching onOption
andResult
where theis_variant
utility methods could be used instead:is_some
,is_none
,is_ok
,is_err
. This PR extends this behaviour tostd::task::Poll
, suggesting the methodsis_pending
andis_ready
.Motivation: The current description of
redundant_pattern_matching
mentionswhich in my mind applies to
Poll
as well.changelog: Enhance [
redundant_pattern_matching
] to also lint onstd::task::Poll