Skip to content

Add Iterator::into_vec() #40051

Closed
Closed
@HyeonuPark

Description

@HyeonuPark

Though we have nice Iterator::collect(), the most common use cases of this method as I've seen are my_iter.collect::Vec<_>(), which is a bit complicated to type. So it would be worth to add this simple shortcut method for it.

#[inline]
fn into_vec(self) -> Vec<Self::Item> {
    self.collect::<Vec<_>>()
}

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