Skip to content

New lint: filter_map_identity #6643

Closed
@camsteffen

Description

@camsteffen

What it does

It's the same as flat_map_identity, but with filter_map.

Example

vec![Some(1)].into_iter().filter_map(|x| x)

Could be written as:

vec![Some(1)].into_iter().flatten()

Metadata

Metadata

Assignees

Labels

A-lintArea: New lintsL-complexityLint: Belongs in the complexity lint groupT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions