9 Iterators and closures again!
This chapter covers
- Using filtering to keep what you want in an iterator
- Reversing, zipping, and cycling iterators
- Taking just the values you want in an iterator
- Determining whether anything or everything in an iterator matches a condition
- Many other methods too numerous to mention here but essential to know
- Using the
dbg!
macro to see what your code is doing at any point
Iterators and closures in Rust have so many methods that we need another full chapter to go over them. There are a lot of these methods, but it’s worth the effort to learn them because they do a lot of work for you. You might not memorize them all during your first reading, but if you remember their names and what they do, you can look them ...
Get Learn Rust in a Month of Lunches now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.