Course lesson

Rustlings iterators2: Introducing Iterators by manually calling .next and using .iter()

README for this exercise.

Duration
2 min
Access
Free
Transcript
Available

README for this exercise.

input.chars() returns an iterator that we manually iterate through using .next().

Later in the program we take advantage of .iter() and the turbofish to reuse the same code across two different use cases.

Also note that an alternative solution is possible where the character uppercase function returns an iterator that is then collected()