Function repeat_n

Source
pub fn repeat_n<T: Clone + Send>(element: T, n: usize) -> RepeatN<T>
Expand description

Creates a parallel iterator that produces n repeats of element (by cloning it).

ยงExamples

use rayon::prelude::*;
use rayon::iter::repeat_n;
let x: Vec<(i32, i32)> = repeat_n(22, 3).zip(0..3).collect();
assert_eq!(x, vec![(22, 0), (22, 1), (22, 2)]);