-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
Description
unnecessary_map_or is a bit of a complicated lint, #14713 suggested distilling part of its behaviour into a separate lint. That issue together with #15998 would split the behaviour entirely in two:
- For inequalities, it would lint the same cases
x.map_or(true, |n| n > 5)but under a different name - For equalities,
x.map_or(false, |n| n == 5)it would first lint throughmanual_is_variant_andintox.is_some_and(|n| n == 5)and then through the lint in suggest== Some(foris_some_andif possible #14713 it would lint intox == Some(5)
After these things are done, I'd consider deprecating the lint all together.
Version
rustc 1.92.0-nightly (57ef8d642 2025-10-15)
binary: rustc
commit-hash: 57ef8d642d21965304bde849bab4f389b4353e27
commit-date: 2025-10-15
host: aarch64-apple-darwin
release: 1.92.0-nightly
LLVM version: 21.1.3
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
No labels