chore(lib): add dyn keyword to trait objects (#1820)
				
					
				
			Requires Rust 1.27.
This commit is contained in:
		| @@ -15,7 +15,7 @@ pub trait MakeService<Ctx> { | ||||
|     type ResBody: Payload; | ||||
|  | ||||
|     /// The error type that can be returned by `Service`s. | ||||
|     type Error: Into<Box<StdError + Send + Sync>>; | ||||
|     type Error: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     /// The resolved `Service` from `new_service()`. | ||||
|     type Service: Service< | ||||
| @@ -28,7 +28,7 @@ pub trait MakeService<Ctx> { | ||||
|     type Future: Future<Item=Self::Service, Error=Self::MakeError>; | ||||
|  | ||||
|     /// The error type that can be returned when creating a new `Service`. | ||||
|     type MakeError: Into<Box<StdError + Send + Sync>>; | ||||
|     type MakeError: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     /// Returns `Ready` when the constructor is ready to create a new `Service`. | ||||
|     /// | ||||
| @@ -49,13 +49,13 @@ pub trait MakeService<Ctx> { | ||||
| pub trait MakeServiceRef<Ctx>: self::sealed::Sealed<Ctx> { | ||||
|     type ReqBody: Payload; | ||||
|     type ResBody: Payload; | ||||
|     type Error: Into<Box<StdError + Send + Sync>>; | ||||
|     type Error: Into<Box<dyn StdError + Send + Sync>>; | ||||
|     type Service: Service< | ||||
|         ReqBody=Self::ReqBody, | ||||
|         ResBody=Self::ResBody, | ||||
|         Error=Self::Error, | ||||
|     >; | ||||
|     type MakeError: Into<Box<StdError + Send + Sync>>; | ||||
|     type MakeError: Into<Box<dyn StdError + Send + Sync>>; | ||||
|     type Future: Future<Item=Self::Service, Error=Self::MakeError>; | ||||
|  | ||||
|     // Acting like a #[non_exhaustive] for associated types of this trait. | ||||
| @@ -77,8 +77,8 @@ pub trait MakeServiceRef<Ctx>: self::sealed::Sealed<Ctx> { | ||||
| impl<T, Ctx, E, ME, S, F, IB, OB> MakeServiceRef<Ctx> for T | ||||
| where | ||||
|     T: for<'a> MakeService<&'a Ctx, Error=E, MakeError=ME, Service=S, Future=F, ReqBody=IB, ResBody=OB>, | ||||
|     E: Into<Box<StdError + Send + Sync>>, | ||||
|     ME: Into<Box<StdError + Send + Sync>>, | ||||
|     E: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     ME: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     S: Service<ReqBody=IB, ResBody=OB, Error=E>, | ||||
|     F: Future<Item=S, Error=ME>, | ||||
|     IB: Payload, | ||||
| @@ -105,8 +105,8 @@ where | ||||
| impl<T, Ctx, E, ME, S, F, IB, OB> self::sealed::Sealed<Ctx> for T | ||||
| where | ||||
|     T: for<'a> MakeService<&'a Ctx, Error=E, MakeError=ME, Service=S, Future=F, ReqBody=IB, ResBody=OB>, | ||||
|     E: Into<Box<StdError + Send + Sync>>, | ||||
|     ME: Into<Box<StdError + Send + Sync>>, | ||||
|     E: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     ME: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     S: Service<ReqBody=IB, ResBody=OB, Error=E>, | ||||
|     F: Future<Item=S, Error=ME>, | ||||
|     IB: Payload, | ||||
| @@ -166,7 +166,7 @@ where | ||||
|     F: FnMut(&Ctx) -> Ret, | ||||
|     Ret: IntoFuture, | ||||
|     Ret::Item: Service<ReqBody=ReqBody, ResBody=ResBody>, | ||||
|     Ret::Error: Into<Box<StdError + Send + Sync>>, | ||||
|     Ret::Error: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     ReqBody: Payload, | ||||
|     ResBody: Payload, | ||||
| { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ pub trait NewService { | ||||
|     type ResBody: Payload; | ||||
|  | ||||
|     /// The error type that can be returned by `Service`s. | ||||
|     type Error: Into<Box<StdError + Send + Sync>>; | ||||
|     type Error: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     /// The resolved `Service` from `new_service()`. | ||||
|     type Service: Service< | ||||
| @@ -27,7 +27,7 @@ pub trait NewService { | ||||
|     type Future: Future<Item=Self::Service, Error=Self::InitError>; | ||||
|  | ||||
|     /// The error type that can be returned when creating a new `Service`. | ||||
|     type InitError: Into<Box<StdError + Send + Sync>>; | ||||
|     type InitError: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     #[doc(hidden)] | ||||
|     fn poll_ready(&mut self) -> Poll<(), Self::InitError> { | ||||
| @@ -42,7 +42,7 @@ impl<F, R, S> NewService for F | ||||
| where | ||||
|     F: Fn() -> R, | ||||
|     R: IntoFuture<Item=S>, | ||||
|     R::Error: Into<Box<StdError + Send + Sync>>, | ||||
|     R::Error: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     S: Service, | ||||
| { | ||||
|     type ReqBody = S::ReqBody; | ||||
|   | ||||
| @@ -21,7 +21,7 @@ pub trait Service { | ||||
|     /// Note: Returning an `Error` to a hyper server will cause the connection | ||||
|     /// to be abruptly aborted. In most cases, it is better to return a `Response` | ||||
|     /// with a 4xx or 5xx status code. | ||||
|     type Error: Into<Box<StdError + Send + Sync>>; | ||||
|     type Error: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     /// The `Future` returned by this `Service`. | ||||
|     type Future: Future<Item=Response<Self::ResBody>, Error=Self::Error>; | ||||
| @@ -104,7 +104,7 @@ where | ||||
|     F: FnMut(Request<ReqBody>) -> Ret, | ||||
|     ReqBody: Payload, | ||||
|     Ret: IntoFuture<Item=Response<ResBody>>, | ||||
|     Ret::Error: Into<Box<StdError + Send + Sync>>, | ||||
|     Ret::Error: Into<Box<dyn StdError + Send + Sync>>, | ||||
|     ResBody: Payload, | ||||
| { | ||||
|     type ReqBody = ReqBody; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user