How do you make a range in Rust?
As of 1.0, for loops work with values of types with the Iterator trait. The book describes this technique in chapter 3.5 and chapter 13.2. If you are interested in how for loops operate, see the described syntactic sugar in Module std::iter. Example: fn main() { let strs = [“red”, “green”, “blue”]; for sptr in … Read more