From 0c18eb97d0e3fcff0b811e8c81c738a0a6e33003 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Wed, 15 Jul 2020 03:39:43 +0100 Subject: [PATCH] NewRequest -> R1, OldRequest -> R2 for generics --- tower/src/util/combinators/try_with.rs | 8 ++++---- tower/src/util/combinators/with.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tower/src/util/combinators/try_with.rs b/tower/src/util/combinators/try_with.rs index a2345fd6f..ba8468d2c 100644 --- a/tower/src/util/combinators/try_with.rs +++ b/tower/src/util/combinators/try_with.rs @@ -19,10 +19,10 @@ impl TryWith { } } -impl Service for TryWith +impl Service for TryWith where - S: Service, - F: FnOnce(NewRequest) -> Result + Clone, + S: Service, + F: FnOnce(R1) -> Result + Clone, { type Response = S::Response; type Error = S::Error; @@ -32,7 +32,7 @@ where self.inner.poll_ready(cx) } - fn call(&mut self, request: NewRequest) -> Self::Future { + fn call(&mut self, request: R1) -> Self::Future { match (self.f.clone())(request) { Ok(ok) => Either::Left(self.inner.call(ok)), Err(err) => Either::Right(ready(Err(err))), diff --git a/tower/src/util/combinators/with.rs b/tower/src/util/combinators/with.rs index 50f1fa34d..cd0c50833 100644 --- a/tower/src/util/combinators/with.rs +++ b/tower/src/util/combinators/with.rs @@ -18,10 +18,10 @@ impl With { } } -impl Service for With +impl Service for With where - S: Service, - F: FnOnce(NewRequest) -> OldRequest + Clone, + S: Service, + F: FnOnce(R1) -> R2 + Clone, { type Response = S::Response; type Error = S::Error; @@ -31,7 +31,7 @@ where self.inner.poll_ready(cx) } - fn call(&mut self, request: NewRequest) -> S::Future { + fn call(&mut self, request: R1) -> S::Future { self.inner.call((self.f.clone())(request)) } }