Change FutureService's associated types to be bounded by IntoFuture rather than Future.

It's strictly more flexible, because everything that impls Future impls IntoFuture, and it
additionally allows returning types like Result. Which is nice.
This commit is contained in:
Tim Kuehn
2017-02-07 19:58:11 -08:00
parent a1072c8c06
commit fe4eab38f1
7 changed files with 35 additions and 33 deletions

View File

@@ -40,10 +40,10 @@ pub mod double {
struct AddServer;
impl AddFutureService for AddServer {
type AddFut = futures::Finished<i32, Never>;
type AddFut = Result<i32, Never>;
fn add(&self, x: i32, y: i32) -> Self::AddFut {
futures::finished(x + y)
Ok(x + y)
}
}