W3cubDocs

/Rust

Keyword in

Iterate over a series of values with for.

The expression immediately following in must implement the IntoIterator trait.

Literal Examples:

  • for _ **in** 1..3 {} - Iterate over an exclusive range up to but excluding 3.
  • for _ **in** 1..=3 {} - Iterate over an inclusive range up to and including 3.

(Read more about range patterns)

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/keyword.in.html