-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 messages
Description
I recently started getting suggestions to replace .map_or(false, ...)
with is_ok_and(...)
/is_some_and(...)
:
warning: this `map_or` is redundant
--> src/main.rs:6:20
|
6 | println!("{}", c.map_or(false, char::is_alphabetic));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `c.is_some_and(char::is_alphabetic)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
I like the suggestions 🙏, but I'm not sure "is redundant" is the right phrase to use in the warning.
Maybe "can be simplified"?
Playground for those who haven't come across this yet.
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 messages