-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
What it does
replace
option.is_none() || option.is_some_and(foo)with
option.is_none_or(foo)Inspired by pop-os/cosmic-comp#1946 (comment)
Advantage
- Simplifies the code
Drawbacks
No response
Example
option.is_none() || option.is_some_and(foo)Could be written as:
option.is_none_or(foo)Comparison with existing lints
There are no similar lints AFAICT
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy