How do I concatenate two slices in Rust?
<p>I want to take the x first and last elements from a vector and concatenate them. I have the following code:</p>

<pre><code>fn main() {
    let v = (0u64 .. 10).collect::&lt;Vec&lt;_&gt;&gt;();
    let l = v.len();
    vec![v.iter().take(3), v.iter().skip(l-3)];
}
</code></pre>

<p>This gives me the error </p>

<pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
 --&gt; &lt;anon&gt;:4:28
  |
4 |     vec![v.iter().take(3), v.iter().skip(l-3)];
  |                            ^^^^^^^^^^^^^^^^^^ expected struct `std::iter::Take`, found struct `std::iter::Skip`
&lt;anon&gt;:4:5: 4:48 note: in this expansion of vec! (defined in &lt;std macros&gt;)
  |
  = note: expected type `std::iter::Take&lt;std::slice::Iter&lt;'_, u64&gt;&gt;`
  = note:    found type `std::iter::Skip&lt;std::slice::Iter&lt;'_, u64&gt;&gt;`
</code></pre>

<p>How do I get my <code>vec</code> of <code>1, 2, 3, 8, 9, 10</code>? I am using Rust 1.12.</p>