title: How can you iterate and change the values in a mutable array in Rust?
body: <p>This is how far I got:</p>
  
  <pre><code>#[derive(Copy, Clone, Debug)]
  enum Suits {
      Hearts,
      Spades,
      Clubs,
      Diamonds,
  }
  
  #[derive(Copy, Clone, Debug)]
  struct Card {
      card_num: u8,
      card_suit: Suits,
  }
  
  fn generate_deck() {
      let deck: [Option&lt;Card&gt;; 52] = [None; 52];
  
      for mut i in deck.iter() {
          i = &amp;Some(Card {
              card_num: 1,
              card_suit: Suits::Hearts,
          });
      }
  
      for i in deck.iter() {
          println!("{:?}", i);
      }
  }
  
  fn main() {
      generate_deck();
  }
  </code></pre>
  
  <p>It only  prints out <code>None</code>. Is there something wrong with my borrowing? What am I doing wrong?</p>