#15997·rust-clippy

Rename (and combine) `unnecessary_option_map_or_else` and `unnecessary_result_map_or_else`

Author: teofrCreated Oct 31, 2025Updated Sep 18, 2026
LabelsA-category

Description

After some discussion on #15801 we came to the conclussion that unnecessary_option_map_or_else and unnecessary_result_map_or_else should probably be a single lint; the implementations are being merged in #15889 .

The options for naming could be:

  • unnecessary_map_or_else, most similar to the historical name
  • map_identity_or_else, semantic naming (the identity is being mapped, rather than the or_else bit)
  • map_or_else_identity, item + case naming

I do like the semantic naming, but I also see lint names more like unique identifiers, and I do think the discoverability of having map_or_else unbroken is important (the power of Ctrl+F). Then again, if names are unique ids a lot of this discussion is pointless.

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