stream-body icon indicating copy to clipboard operation
stream-body copied to clipboard

Cannot find function spawn

Open DreamTexX opened this issue 2 years ago • 0 comments

error[E0425]: cannot find function `spawn` in crate `tokio`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/stream-body-0.1.1/src/body.rs:104:16
    |
104 |         tokio::spawn(async move {
    |                ^^^^^ not found in `tokio`
    |
help: consider importing this function
    |
1   | use std::thread::spawn;
    |
help: if you import `spawn`, refer to it directly
    |
104 -         tokio::spawn(async move {
104 +         spawn(async move {
    |

error[E0425]: cannot find function `copy` in module `io`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/stream-body-0.1.1/src/body.rs:105:35
    |
105 |             if let Err(err) = io::copy(&mut r, &mut w).await {
    |                                   ^^^^ not found in `io`
    |
help: consider importing one of these items
    |
1   | use core::mem::copy;
    |
1   | use core::ptr::copy;
    |
1   | use std::fs::copy;
    |
1   | use std::io::copy;
    |
      and 2 other candidates
help: if you import `copy`, refer to it directly
    |
105 -             if let Err(err) = io::copy(&mut r, &mut w).await {
105 +             if let Err(err) = copy(&mut r, &mut w).await {
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `stream-body` due to 2 previous errors

How can i fix this?

DreamTexX avatar Mar 02 '23 14:03 DreamTexX