Function itertools::iterate [−][src]
Expand description
Creates a new iterator that infinitely applies function to value and yields results.
use itertools::iterate;
itertools::assert_equal(iterate(1, |&i| i * 3).take(5), vec![1, 3, 9, 27, 81]);