title: Rust: Folding a set of tuples
body: <p>I'm working on a pet project and I've found myself with a HashSet of tuples. Specifically</p>
  <pre><code>HashSet&lt;(String,generic_array::GenericArray&lt;u8,generic_array::typenum::U32&gt;, u64)&gt;
  </code></pre>
  <p>I'd like to sum the u64 element and can do so with a for loop without issue:</p>
  <pre><code>for element in hashset{
          sum = sum+element.2;
      }
  </code></pre>
  <p>However, I've come across the fold function for sets and I've written:</p>
  <pre><code>let y = hashset.fold(0, |sum x| sum+x)
  </code></pre>
  <p>Which works, but I'm unclear on the syntax of the <code>|sum x|</code>. I can infer that I'm simply naming variables, but I don't understand how I would expand on this. Also how does fold know which element of the tuple to operate on?</p>