Creates a parallel iterator that endlessly repeats
cloning it). Note that this iterator has “infinite” length, so
typically you would want to use
take or some other
means to shorten it, or consider using
repeatn() function instead.
use rayon::prelude::*; use rayon::iter::repeat; let x: Vec<(i32, i32)> = repeat(22).zip(0..3).collect(); assert_eq!(x, vec![(22, 0), (22, 1), (22, 2)]);