Skip to main content

repeat_n

Function repeat_n 

Source
pub fn repeat_n<T: Clone>(value: T, count: usize) -> impl Iterator<Item = T>
Expand description

An iterator that repeats value exactly count times.

Modern: iter::repeat_n (stable since Rust 1.87). Vintage (1.73): the equivalent iter::repeat(value).take(count).