title: Dispatching Rust TcpStream from TcpListener to separate method in loop
body: <p>I'm new to Rust and have the following code:</p>
  <pre class="lang-rust prettyprint-override"><code>while let Some(tcp_stream) = incoming.next() {
      match tcp_stream {
          Ok(s) =&gt; {
              handle_request(tcp_stream.unwrap(), &amp;routes);
          }
          Err(ref e) if e.kind() == io::ErrorKind::WouldBlock =&gt; {
              continue;
          }
          Err(e) =&gt; panic!(&quot;Error&quot;),
      };
  }
  </code></pre>
  <p>And I get the following error:</p>
  <pre class="lang-none prettyprint-override"><code>use of moved value: `tcp_stream`
  
  value used here after partial move
  
  note: move occurs because value has type `std::net::TcpStream`, which does not implement the `Copy` trait rustc(E0382)
  lib.rs(72, 20): value moved here
  lib.rs(73, 36): value used here after partial move
  </code></pre>
  <p>What I'm looking to do is handle the new connection/TcpStream in a separate method <code>handle_request</code> but I'm unsure how to go about doing this. Passing a reference gives the same issue. I tried implementing the <code>Copy</code> trait for <code>TcpStream</code> but since I'm outside of its crate I can't seem to do that.</p>
  <p>Any pointers would be greatly appreciated!</p>