-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
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
Description
None of the following currently get linted:
#![allow(unused)]
#![warn(clippy::unnecessary_lazy_evaluations)]
fn main() {
let o = Some(42);
o.map_or(42, |_| 42);
o.map_or_else(|| 42, |_| 42);
let r: Result<i32, i32> = Ok(42);
r.map_or(42, |_| 42);
r.map_or_else(|_| 42, |_| 42);
}
It would be cool if they did
Version
rustc 1.92.0-nightly (839222065 2025-10-05)
binary: rustc
commit-hash: 839222065a44ac21c15df68ed2f2f3c0127b0b8e
commit-date: 2025-10-05
host: x86_64-unknown-linux-gnu
release: 1.92.0-nightly
LLVM version: 21.1.2
Additional Labels
@rustbot label C-enhancement "good first issue"
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