I am currently learning Rust, and I stumbled upon an operation for which I can find neither a standard implementation in std nor a reasonably formed snippet of code, which would do what I would like it to do.
Basically I would like to repeat each element of an iterator a given number of times. So for example if a had an iterator of [1,2,3], then by repeating each element 3 times for example I mean that output should be [1,1,1,2,2,2,3,3,3].
How would one do it idiomatically in Rust?