Skip to content

Cannot find function spawn #5

@DreamTexX

Description

@DreamTexX
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions