Skip to content

Suggestions: Iterators #504

@Veedrac

Description

@Veedrac

.filter().next().find()
.find().is_some().any()

These seem to catch people out rather frequently. It catches me out because it's what you do in Python. This also technically includes:

.position().is_some().any()
.rposition().is_some().any()

Perhaps also the similar Python idiom

left.zip(right).all(|(a, b)| a == b)left.eq(right)

although that's contingent on length equality.

There's also the question of whether filter_map is better than flat_map when returning Option<T>. They're kind'a the same thing, but maybe one is better than the other. Maybe not though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsT-ASTType: Requires working with the ASTgood 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