title: How do I create an empty byte array?
body: <p>How can I create an empty <code>[u8]</code> that I can then pass to an openssl function so it can write it's result to it?</p>
  
  <pre><code>fn test_encrypt(key_pair: openssl::rsa::Rsa) {
      let text = b"Hello";
      println!("{:?}", text);
      let mut result = b" ";
      let pad = openssl::rsa::Padding::from_raw(1);
      key_pair.private_encrypt(text, result, pad);
  }
  </code></pre>
  
  <p>My code currently results in the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/main.rs:20:36
     |
  20 |     key_pair.private_encrypt(text, result, pad);
     |                                    ^^^^^^ types differ in mutability
     |
     = note: expected type `&amp;mut [u8]`
                found type `&amp;[u8; 0]`
  </code></pre>