title: How to repeat each element of iterator n times?
body: <p>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.</p>
  <p>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 <code>[1,2,3]</code>, then by repeating each element 3 times for example I mean that output should be <code>[1,1,1,2,2,2,3,3,3]</code>.</p>
  <p>How would one do it idiomatically in Rust?</p>