Skip to content

rust guide: take() confusingly described as returning a list #18218

Closed
@giogadi

Description

@giogadi

In the iterator adapters section of the Rust Guide:

http://doc.rust-lang.org/0.12.0/guide.html#iterator-adapters

The following sentence is used to describe the take() function:

"take(n) will get the first n items out of an iterator, and return them as a list."

This is a bit confusing; most programmers would think of Rust's arrays when they hear the term "list", but this conflicts with the key point that should be made here, which is that take() takes an iterator and returns another iterator as a result.

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