Simplify handler trait (#221)

Rely on the `impl FromRequest for (T, ...)` rather than extracting things directly inside the macro.
This commit is contained in:
David Pedersen
2021-08-20 20:36:34 +02:00
committed by GitHub
parent e8bc3f5082
commit 44c58bdf5f
4 changed files with 108 additions and 110 deletions
+2 -8
View File
@@ -2,10 +2,7 @@
use crate::body::{box_body, BoxBody};
use crate::util::{Either, EitherProj};
use futures_util::{
future::{BoxFuture, Map},
ready,
};
use futures_util::{future::BoxFuture, ready};
use http::{Method, Request, Response};
use http_body::Empty;
use pin_project_lite::pin_project;
@@ -67,8 +64,5 @@ where
opaque_future! {
/// The response future for [`IntoService`](super::IntoService).
pub type IntoServiceFuture =
Map<
BoxFuture<'static, Response<BoxBody>>,
fn(Response<BoxBody>) -> Result<Response<BoxBody>, Infallible>,
>;
BoxFuture<'static, Result<Response<BoxBody>, Infallible>>;
}