title: Pass forward a map iterator in rust
body: <p>Conceptually, I'd like to have an &quot;extended&quot; HashMap class that I'll call a FrequencyTable</p>
  <pre><code>#[derive(Clone)]
  pub struct FrequencyTable&lt;K,V&gt;(HashMap&lt;K,HashSet&lt;V&gt;&gt;);
  </code></pre>
  <p>I'd like to define a &quot;default&quot; that goes over the <code>HashMap</code> member.</p>
  <p>My first attempt was</p>
  <pre><code>impl&lt;K,V&gt; std::iter::IntoIterator for FrequencyTable&lt;K,V&gt; {
      type Item = (K,HashSet&lt;V&gt;);
      type IntoIter = std::collections::hash_map::Iter&lt;'static, K, HashSet&lt;V&gt;&gt;;
  
      fn into_iter(self) -&gt; std::collections::hash_map::Iter&lt;'static, K, HashSet&lt;V&gt;&gt; {
          self.0.iter()
      }
  }
  </code></pre>
  <p>which complains because <code>K</code> and <code>V</code> need lifetime bounds so I tried</p>
  <pre><code>impl&lt;K,V&gt; std::iter::IntoIterator for FrequencyTable&lt;K,V&gt; where K: 'static, V:'static {
      type Item = (K,HashSet&lt;V&gt;);
      type IntoIter = std::collections::hash_map::Iter&lt;'static, K, HashSet&lt;V&gt;&gt;;
  
      fn into_iter(self) -&gt; std::collections::hash_map::Iter&lt;'static, K, HashSet&lt;V&gt;&gt; {
          self.0.iter()
      }
  }
  </code></pre>
  <p>which then says <code>expected parameter 'k', found '&amp;K' ...</code> But adding <code>&amp;</code>s to the variables didn't solve the error.</p>