Keyword in

source[]
Expand description

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)