Skip to content

Consider adding a .foreach()-like method to Iterator #24566

Closed
@alexcrichton

Description

@alexcrichton

Proposed in rust-lang/rfcs#582 and rust-lang/rfcs#1064, the Iterator trait could have a .foreach method which drains the iterator immediately and runs a closure on each element to concisely do so without a for loop.

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