title: How do I intersect two HashSets while moving values in common into a new set?
body: <pre><code>use std::collections::HashSet;
  let mut a: HashSet&lt;T&gt; = HashSet::new();
  let mut b: HashSet&lt;T&gt; = HashSet::new();
  let mut c: HashSet&lt;T&gt; = a.intersection(&amp;b).collect();
  // Error: a collection of type `std::collections::HashSet&lt;T&gt;` cannot be built from an iterator over elements of type `&amp;T`
  </code></pre>
  
  <p>I no longer need the non-intersecting values. 
  How do I steal/move the data from the sets <code>a</code> and <code>b</code> into <code>c</code> without copying or cloning? Ideally, this would have the theoretically optimal time-complexity: O(min(a, b)).</p>