title: Sorting a vector of tuples needs a reference for the second value?
body: <p>I have a vector of tuples of integers and want to sort it by the second element of each tuple:</p>
  
  <pre><code>fn main() {
      let mut tuple_list2: Vec&lt;(u16, u16)&gt; = vec![(1, 5), (0, 17), (8, 2)];
      tuple_list2.sort_by(|a, b| a.1.cmp(b.1));
  }
  </code></pre>
  
  <p>The compiler throws an error because <code>b.1</code> is a <code>u16</code> and not a reference to one (<code>&amp;u16</code>). I can solve this problem by referencing <code>b.1</code> instead:</p>
  
  <pre><code>fn main() {
      let mut tuple_list2: Vec&lt;(u16, u16)&gt; = vec![(1, 5), (0, 17), (8, 2)];
      tuple_list2.sort_by(|a, b| a.1.cmp(&amp;b.1));
  }
  </code></pre>
  
  <p>I don't understand why I have to do this. Especially because I do not need to reference <code>a.1</code>, either.</p>