Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

.take should close the underlying iterator as soon as the final item is taken #219

@bakkot

Description

@bakkot

Right now if you do

let bounded = iter.take(3);
bounded.next();
bounded.next();
bounded.next();

this will not close iter. You have to call bounded.next() again to actually close out the underlying iterator. That seems surprising to me.

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