Skip to content

Commit 68127f0

Browse files
committed
Revert "feat: Add impl Service<http::Request<Body>> for Client and &'_ Client (#2356)"
This reverts commit 522216e.
1 parent b2a28f5 commit 68127f0

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

src/async_impl/client.rs

-56
Original file line numberDiff line numberDiff line change
@@ -2161,62 +2161,6 @@ impl tower_service::Service<Request> for &'_ Client {
21612161
}
21622162
}
21632163

2164-
impl tower_service::Service<http::Request<crate::Body>> for Client {
2165-
type Response = http::Response<crate::Body>;
2166-
type Error = crate::Error;
2167-
type Future = MappedPending;
2168-
2169-
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
2170-
Poll::Ready(Ok(()))
2171-
}
2172-
2173-
fn call(&mut self, req: http::Request<crate::Body>) -> Self::Future {
2174-
match req.try_into() {
2175-
Ok(req) => MappedPending::new(self.execute_request(req)),
2176-
Err(err) => MappedPending::new(Pending::new_err(err)),
2177-
}
2178-
}
2179-
}
2180-
2181-
impl tower_service::Service<http::Request<crate::Body>> for &'_ Client {
2182-
type Response = http::Response<crate::Body>;
2183-
type Error = crate::Error;
2184-
type Future = MappedPending;
2185-
2186-
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
2187-
Poll::Ready(Ok(()))
2188-
}
2189-
2190-
fn call(&mut self, req: http::Request<crate::Body>) -> Self::Future {
2191-
match req.try_into() {
2192-
Ok(req) => MappedPending::new(self.execute_request(req)),
2193-
Err(err) => MappedPending::new(Pending::new_err(err)),
2194-
}
2195-
}
2196-
}
2197-
2198-
pin_project! {
2199-
pub struct MappedPending {
2200-
#[pin]
2201-
inner: Pending,
2202-
}
2203-
}
2204-
2205-
impl MappedPending {
2206-
fn new(inner: Pending) -> MappedPending {
2207-
Self { inner }
2208-
}
2209-
}
2210-
2211-
impl Future for MappedPending {
2212-
type Output = Result<http::Response<crate::Body>, crate::Error>;
2213-
2214-
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
2215-
let inner = self.project().inner;
2216-
inner.poll(cx).map_ok(Into::into)
2217-
}
2218-
}
2219-
22202164
impl fmt::Debug for ClientBuilder {
22212165
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
22222166
let mut builder = f.debug_struct("ClientBuilder");

0 commit comments

Comments
 (0)