Function core::iter::successors
1.34.0 · source · pub fn successors<T, F>(first: Option<T>, succ: F) -> Successors<T, F> ⓘ
Expand description
Creates a new iterator where each successive item is computed based on the preceding one.
The iterator starts with the given first item (if any)
and calls the given FnMut(&T) -> Option<T>
closure to compute each item’s successor.