From 90ad1b12a8a5826942b4dc13fe2a695e22d06bc8 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 17 Sep 2018 18:49:55 -0700 Subject: [PATCH] do not constrain InitError for from_err new service --- src/service/from_err.rs | 14 +++++++------- src/service/mod.rs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/service/from_err.rs b/src/service/from_err.rs index d0e40c58..c4ee7618 100644 --- a/src/service/from_err.rs +++ b/src/service/from_err.rs @@ -89,7 +89,7 @@ pub struct FromErrNewService { impl FromErrNewService where A: NewService, - E: From + From, + E: From, { /// Create new `FromErr` new service instance pub fn new(a: A) -> Self { @@ -100,7 +100,7 @@ where impl Clone for FromErrNewService where A: NewService + Clone, - E: From + From, + E: From, { fn clone(&self) -> Self { Self { @@ -113,14 +113,14 @@ where impl NewService for FromErrNewService where A: NewService, - E: From + From, + E: From, { type Request = A::Request; type Response = A::Response; type Error = E; type Service = FromErr; - type InitError = E; + type InitError = A::InitError; type Future = FromErrNewServiceFuture; fn new_service(&self) -> Self::Future { @@ -134,7 +134,7 @@ where pub struct FromErrNewServiceFuture where A: NewService, - E: From + From, + E: From, { fut: A::Future, e: PhantomData, @@ -143,10 +143,10 @@ where impl Future for FromErrNewServiceFuture where A: NewService, - E: From + From, + E: From, { type Item = FromErr; - type Error = E; + type Error = A::InitError; fn poll(&mut self) -> Poll { if let Async::Ready(service) = self.fut.poll()? { diff --git a/src/service/mod.rs b/src/service/mod.rs index dbfb99f8..41441cdb 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -141,7 +141,7 @@ pub trait NewServiceExt: NewService { fn from_err(self) -> FromErrNewService where Self: Sized, - E: From + From, + E: From, { FromErrNewService::new(self) }