title: How can you get the sum of all keys in an array of structs?
body: <p>I have this struct:</p>
  
  <pre><code>struct MyStruct {
      myvalue: u32,
      yourvalue: u32,
  }
  </code></pre>
  
  <p>If I have <code>a: Vec&lt;MyStruct&gt;</code> how can I get the sum of all <code>MyStruct.myvalue</code>? I'm looking for something like <code>a.iter.sum(sum of myvalue)</code>.</p>
  
  <p>I know I can do it with a <code>for</code> loop, but I would like to be able to do this with one line of code.</p>