repeat_n

Function repeat_n 

pub fn repeat_n<T>(element: T, n: usize) -> RepeatN<T>
where T: Clone + Send,
Available on crate feature trie only.
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)]);