6 ms·
fwiw, Option already implements iterator (well, IntoIterator) - calling .into_iter() on an Option will get you an iterator, no need to create anything custom.
by Patryk27 2y 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.
- antonvs 2y agoI wonder if that existed when this article was written in 2018.
- MereInterest 2y agoThe footnotes mention that this solution was suggested by Reddit comments at the time.