mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Remove B type param: Follow ups (#1789)
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
Michael Scofield
parent
72c1b7a80c
commit
6703f8634c
@@ -1,6 +1,9 @@
|
||||
use axum::{body::BoxBody, http::header::CONTENT_TYPE, response::IntoResponse};
|
||||
use axum::{
|
||||
extract::Request,
|
||||
http::header::CONTENT_TYPE,
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use futures::{future::BoxFuture, ready};
|
||||
use hyper::{Body, Request, Response};
|
||||
use std::{
|
||||
convert::Infallible,
|
||||
task::{Context, Poll},
|
||||
@@ -41,16 +44,16 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<A, B> Service<Request<Body>> for MultiplexService<A, B>
|
||||
impl<A, B> Service<Request<hyper::Body>> for MultiplexService<A, B>
|
||||
where
|
||||
A: Service<Request<Body>, Error = Infallible>,
|
||||
A: Service<Request<hyper::Body>, Error = Infallible>,
|
||||
A::Response: IntoResponse,
|
||||
A::Future: Send + 'static,
|
||||
B: Service<Request<Body>>,
|
||||
B: Service<Request<hyper::Body>>,
|
||||
B::Response: IntoResponse,
|
||||
B::Future: Send + 'static,
|
||||
{
|
||||
type Response = Response<BoxBody>;
|
||||
type Response = Response;
|
||||
type Error = B::Error;
|
||||
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
|
||||
|
||||
@@ -73,7 +76,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn call(&mut self, req: Request<Body>) -> Self::Future {
|
||||
fn call(&mut self, req: Request<hyper::Body>) -> Self::Future {
|
||||
// require users to call `poll_ready` first, if they don't we're allowed to panic
|
||||
// as per the `tower::Service` contract
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user