title: How do I destructure a vector without taking a slice?
body: <p>I can destructure a vector of tuples by taking a slice of a vector and references to the items within the tuple:</p>
  
  <pre><code>let items = vec![("Peter".to_string(), 180)];
  
  if let [(ref name, ref age)] = items.as_slice() {
      println!("{} scored {}", name, age);
  };
  </code></pre>
  
  <p>How can I destructure the vector directly, moving the items out of the tuple. Something like this:</p>
  
  <pre><code>let items = vec![("Peter".to_string(), 180)];
  
  if let [(name, age)] = items {
      println!("{} scored {}", name, age);
  };
  </code></pre>
  
  <p>Compiling the above results in the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0529]: expected an array or slice, found `std::vec::Vec&lt;(std::string::String, {integer})&gt;`
   --&gt; src/main.rs:4:12
    |
  4 |     if let [(name, age)] = items {
    |            ^^^^^^^^^^^^^ pattern cannot match with input type `std::vec::Vec&lt;(std::string::String, {integer})&gt;`
  </code></pre>