Skip to content

Add empty method to iterators #11218

Closed
@jdm

Description

@jdm

Sometimes it's desirable to check whether an iterator will return any elements without using len, which is (presumably) O(N). You can probably use some_iterator.any(|_| true), but it would be nicer to hide that behind a nicer API I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions