title: How can I convert a ZipWriter to Bytes in Rust?
body: <p>I want to create a zip from a certain file, then i convert this zip (A buffer, not a file in the disk) to bytes, then to send it by a post body to an api.</p>
  <p>Thats the code (simplifyed) just with the essencial, and from now to the next step, how can i convert it into bytes?</p>
  <pre class="lang-rust prettyprint-override"><code>pub fn to_zip() {
      let buf: &amp;mut [u8] = &amp;mut [0u8; 65536];
      let w = std::io::Cursor::new(buf);
      let mut zip = zip::ZipWriter::new(w);
  
      // * Convert the buffer to bytes
  
      zip.finish().unwrap();
  }
  </code></pre>
  <p>Sorry for a maybe confuse code first time with Rust beeing loving it so far!</p>