title: How do I use a Tokio oneshot sender and receiver on different tasks with inner loops?
body: <p>Not sure how to handler the borrow checker here.</p>
  <pre class="lang-rust prettyprint-override"><code>use tokio::sync::oneshot; // 1.0.2
  
  fn main() {
      let (sender, receiver) = oneshot::channel::&lt;u8&gt;();
      tokio::spawn(async move {
          loop {
              sender.send(3).unwrap();
          }
      });
  }
  </code></pre>
  <p>Creates this error:</p>
  <pre class="lang-none prettyprint-override"><code>error[E0382]: use of moved value: `sender`
   --&gt; src/main.rs:7:13
    |
  7 |             sender.send(3).unwrap();
    |             ^^^^^^ value moved here, in previous iteration of loop
    |
    = note: move occurs because `sender` has type `tokio::sync::oneshot::Sender&lt;u8&gt;`, which does not implement the `Copy` trait
  </code></pre>