chore(lib): add dyn keyword to trait objects (#1820)

Requires Rust 1.27.
This commit is contained in:
Sean McArthur
2019-06-03 13:08:13 -07:00
committed by GitHub
parent e0f5a9c6c5
commit 01c03db7ea
28 changed files with 107 additions and 94 deletions

View File

@@ -1,3 +1,4 @@
#![deny(warnings)]
extern crate futures;
extern crate hyper;
@@ -12,7 +13,7 @@ use hyper::{Body, Method, Request, Response, Server, StatusCode};
///
/// A boxed Future (trait object) is used as it is easier to understand
/// and extend with more types. Advanced users could switch to `Either`.
type BoxFut = Box<Future<Item = Response<Body>, Error = hyper::Error> + Send>;
type BoxFut = Box<dyn Future<Item = Response<Body>, Error = hyper::Error> + Send>;
/// This is our service handler. It receives a Request, routes on its
/// path, and returns a Future of a Response.