Yet Another Rust Iterators Tutorial

#1

Hi all,

Just to let you know I wrote a Rust iterators tutorial in dev.to: https://dev.to/dandyvica/yarit-yet-another-rust-iterators-tutorial-46dk

Hope it’ll help newcomers.

Comments welcome !

4 Likes
#2

I like it!

Consider, in the implementation section, mentioning a few of the optional methods that may also be useful to override, like nth and fold (see https://github.com/rust-lang/rust/issues/60223).

A few code review nitpicks:

  • Consider deriving Debug on the iterator struct
  • Consider what Fibonacci should do on overflow, perhaps let next_fib = self.fib_n.checked_add(self.fib_n_1)?;