diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index d7defc578..0a7281c42 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -2161,62 +2161,6 @@ impl tower_service::Service for &'_ Client { } } -impl tower_service::Service> for Client { - type Response = http::Response; - type Error = crate::Error; - type Future = MappedPending; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, req: http::Request) -> Self::Future { - match req.try_into() { - Ok(req) => MappedPending::new(self.execute_request(req)), - Err(err) => MappedPending::new(Pending::new_err(err)), - } - } -} - -impl tower_service::Service> for &'_ Client { - type Response = http::Response; - type Error = crate::Error; - type Future = MappedPending; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, req: http::Request) -> Self::Future { - match req.try_into() { - Ok(req) => MappedPending::new(self.execute_request(req)), - Err(err) => MappedPending::new(Pending::new_err(err)), - } - } -} - -pin_project! { - pub struct MappedPending { - #[pin] - inner: Pending, - } -} - -impl MappedPending { - fn new(inner: Pending) -> MappedPending { - Self { inner } - } -} - -impl Future for MappedPending { - type Output = Result, crate::Error>; - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let inner = self.project().inner; - inner.poll(cx).map_ok(Into::into) - } -} - impl fmt::Debug for ClientBuilder { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut builder = f.debug_struct("ClientBuilder");