Skip to content

Document that IntoIterator allows for for...in sugar #23851

Description

@frewsxcv

http://doc.rust-lang.org/core/iter/trait.IntoIterator.html

I think we should mention somewhere in the docs for IntoIterator that implementing this trait allows one to write:

let my_vec = vec![1, 10, 100];
for i in my_vec { ... }

instead of

let my_vec = vec![1, 10, 100];
for i in my_vec.iter() { ... }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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