-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
Summary
https://godbolt.org/z/GbzzGqb9G
Lint Name
map_unwrap_or
Reproducer
I tried this code:
pub fn m1(result: Result<i32, ()>) -> bool {
result
.map(|x| x == 42)
.unwrap_or(false)
}I expected to see this happen:
warning: called `map(<f>).unwrap_or(false)` on an `Result` value
...
help: use `is_ok_and(<f>)` instead
Instead, this happened:
no lint
Version
nightly
krobelus
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't