Closed aaryanpunia closed 3 months ago
Thanks for the report! I think I didn't fully update the example for the latest version. Can you try using version 0.34 (and you can remove the unused imports, too)?
I updated the readme; can you try again?
Now I get this error
error[E0277]: `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>` is not a future
--> src/main.rs:30:18
|
30 | tokio::spawn(server.execute(HelloServer.serve()));
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>` is not a future
| |
| required by a bound introduced by this call
|
= help: the trait `Future` is not implemented for `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>`
note: required by a bound in `tokio::spawn`
--> /Users/aaryanpunia/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/task/spawn.rs:166:12
|
164 | pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
| ----- required by a bound in this function
165 | where
166 | F: Future + Send + 'static,
| ^^^^^^ required by this bound in `spawn`
error[E0277]: `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>` is not a future
--> src/main.rs:30:5
|
30 | tokio::spawn(server.execute(HelloServer.serve()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>` is not a future
|
= help: the trait `Future` is not implemented for `impl futures_core::stream::Stream<Item = impl Future<Output = ()>>`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `raft` (bin "raft") due to 2 previous errors
Oops, let's try this one more time! Sorry, just got off a plane and going on one hour of sleep...
Also note the additional import, use futures::prelude::*;
.
Works now! thank you!
Thank you for helping make the documentation better!
I was trying to implement the README example on the repository, and it doesn't compile, when using all the dependencies specified and copy pasting the code, I get the following error -