Hacker News new | ask | show | jobs
by Patryk27 643 days ago
fwiw, Option already implements iterator (well, IntoIterator) - calling .into_iter() on an Option will get you an iterator, no need to create anything custom.
1 comments

I wonder if that existed when this article was written in 2018.
The footnotes mention that this solution was suggested by Reddit comments at the time.