title: Is there a more idiomatic way to initialize an array with random numbers than a for loop?
body: <p>Is there an idiomatic way of initialising arrays in Rust. I'm creating an array of random numbers and was wondering if there is a more idiomatic way then just doing a for loop. My current code works fine, but seems more like C than proper Rust:</p>
  
  <pre><code>let mut my_array: [u64; 8] = [0; 8];
  for i in 0..my_array.len() {
      my_array[i] = some_function();
  }
  </code></pre>