diff --git a/examples/hello.rs b/examples/hello.rs index f702478b..0f6b0e24 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -4,6 +4,8 @@ extern crate futures; extern crate pretty_env_logger; //extern crate num_cpus; +use futures::future::FutureResult; + use hyper::header::{ContentLength, ContentType}; use hyper::server::{Http, Service, Request, Response}; @@ -16,9 +18,9 @@ impl Service for Hello { type Request = Request; type Response = Response; type Error = hyper::Error; - type Future = ::futures::Finished; + type Future = FutureResult; fn call(&self, _req: Request) -> Self::Future { - ::futures::finished( + futures::future::ok( Response::new() .with_header(ContentLength(PHRASE.len() as u64)) .with_header(ContentType::plaintext()) diff --git a/examples/server.rs b/examples/server.rs index 5d29d3db..200d7845 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -3,6 +3,8 @@ extern crate futures; extern crate hyper; extern crate pretty_env_logger; +use futures::future::FutureResult; + use hyper::{Get, Post, StatusCode}; use hyper::header::ContentLength; use hyper::server::{Http, Service, Request, Response}; @@ -16,10 +18,10 @@ impl Service for Echo { type Request = Request; type Response = Response; type Error = hyper::Error; - type Future = ::futures::Finished; + type Future = FutureResult; fn call(&self, req: Request) -> Self::Future { - ::futures::finished(match (req.method(), req.path()) { + futures::future::ok(match (req.method(), req.path()) { (&Get, "/") | (&Get, "/echo") => { Response::new() .with_header(ContentLength(INDEX.len() as u64))