How to convert from &[u8] to Vec<u8>? : <p>I'm attempting to simply convert a slice to a vector. The following code:</p>

<pre><code>let a = &amp;[0u8];
let b: Vec&lt;u8&gt; = a.iter().collect();
</code></pre>

<p>fails with the following error message: </p>

<pre><code>3 |     let b: Vec&lt;u8&gt; = a.iter().collect();
  |                               ^^^^^^^ a collection of type `std::vec::Vec&lt;u8&gt;` cannot be built from an iterator over elements of type `&amp;u8`
</code></pre>

<p>What am I missing?</p>
