Skip to content

manual_is_variant_add but for filter instead of map #16518

@link2xt

Description

@link2xt

What it does

Replace .filter() with .is_some() with .is_some_and().

Advantage

Same as manual_is_variant_add, maybe this check should be part of the same lint.

Drawbacks

No response

Example

foo.filter(|x| condition(x)).is_some()

Could be written as:

foo.is_some_and(|x| condition(x))

Comparison with existing lints

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

A-lintArea: New lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions