Function maybe_rayon::iter::repeatn

source ·
pub fn repeatn<T>(elt: T, n: usize) -> RepeatN<T>where
    T: Clone + Send,
Expand description

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

Examples

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