thruster-rs / Thruster

A fast, middleware based, web framework written in Rust
MIT License
1.07k stars 47 forks source link

Example doesn't work #32

Closed frol closed 6 years ago

frol commented 6 years ago

I am getting the following error:

error[E0277]: the trait bound `futures::future::FutureResult<thruster::BasicContext, _>: futures::future::Future` is not satisfied
  --> src/main.rs:21:3
   |
21 |   Box::new(future::ok(context))
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `futures::future::Future` is not implemented for `futures::future::FutureResult<thruster::BasicContext, _>`
   |
   = note: required for the cast to the object type `futures::future::Future<Item=thruster::BasicContext, Error=std::io::Error> + std::marker::Send`

Also, it seems that there is no need to list serde, serde_json, and tokio explicitly in the example project.

Rust version: 1.27 and Nightly (2018-06-19).

P.S. I had to comment #![feature(test)] in the lib.rs to get it compiling to this state on stable Rust.

trezm commented 6 years ago

ah yes, great catch! Haven't updated the example in the readme (or the "most_basic" example,) will push an update to fix this shortly.

frol commented 6 years ago

Well, the actual fix for the compilation error was to pin Futures to 0.1.x :)

trezm commented 6 years ago

Ah, sure, that makes sense! There's a hard bottom on the futures because of the tokio runtime dependency. Thanks for circling back on this!