Skip to content

Refactor unnecessary_{option,result}_map_or_else and merge implementations #15916

@teofr

Description

@teofr

Description

As reported by @ada4a on #15801 both unnecessary_option_map_or_else and unnecessary_result_map_or_else have a two bespoke implementations to identify identity closures.

clippy_utils have is_expr_identity_function which is probably a better option to use.

Similarly, both lint implementations are similar enough that they should be merged into one.

Version


Additional Labels

@rustbot claim
@rustbot label C-enhancement

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions