I am trying to run the hello.rs (https://github.com/seanmonstar/warp/blob/master/examples/hello.rs) example but keep getting this error:
error[E0277]: the trait bound `(): std::future::Future` is not satisfied
--> src/main.rs:10:5
|
10 | warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
In Cargo.toml I have this:
[dependencies]
warp = "0.1"
tokio = "0.2.0-alpha.6"
What could I be missing?
Thanks in advance.
Hi nbari, to use warp with async await you need to depend on the git repo :
[dependencies]
warp = { git = "https://github.com/seanmonstar/warp.git" }
Master (and its examples) are using the new std::future type, v0.1 does not. You can look at the 0.1.x branch for its examples, or depend on warp via git.
Most helpful comment
Hi nbari, to use warp with async await you need to depend on the git repo :