diff options
| author | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
| commit | 4509fe5f942b2430d1f5abb3d1eb336ec2930a33 (patch) | |
| tree | 4dc531b2005740ec5048350ecdae7ba15836e058 /src/handler/response | |
| parent | feat(cargo): bump 0.3.1 -> 0.3.2 (diff) | |
| download | windmark-4509fe5f942b2430d1f5abb3d1eb336ec2930a33.tar.xz windmark-4509fe5f942b2430d1f5abb3d1eb336ec2930a33.zip | |
fix(context): custom parameters format for easy lifetimes
Diffstat (limited to 'src/handler/response')
| -rw-r--r-- | src/handler/response/route.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handler/response/route.rs b/src/handler/response/route.rs index a65b889..c7df774 100644 --- a/src/handler/response/route.rs +++ b/src/handler/response/route.rs @@ -23,16 +23,16 @@ use crate::{context::RouteContext, Response}; #[allow(clippy::module_name_repetitions)] #[async_trait] pub trait RouteResponse: Send + Sync { - async fn call(&mut self, context: RouteContext<'_>) -> Response; + async fn call(&mut self, context: RouteContext) -> Response; } #[async_trait] impl<T, F> RouteResponse for T where - T: FnMut(RouteContext<'_>) -> F + Send + Sync, + T: FnMut(RouteContext) -> F + Send + Sync, F: std::future::Future<Output = Response> + Send + 'static, { - async fn call(&mut self, context: RouteContext<'_>) -> Response { + async fn call(&mut self, context: RouteContext) -> Response { (*self)(context).await } } |