aboutsummaryrefslogtreecommitdiff
path: root/src/router.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-06 08:34:24 +0000
committerFuwn <[email protected]>2023-04-06 08:34:24 +0000
commit873cef6fbba01c99733c97378b5f001779604cf4 (patch)
tree4dc531b2005740ec5048350ecdae7ba15836e058 /src/router.rs
parentfeat(cargo): bump 0.3.1 -> 0.3.2 (diff)
downloadwindmark-873cef6fbba01c99733c97378b5f001779604cf4.tar.xz
windmark-873cef6fbba01c99733c97378b5f001779604cf4.zip
fix(context): custom parameters format for easy lifetimes
Diffstat (limited to 'src/router.rs')
-rw-r--r--src/router.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/router.rs b/src/router.rs
index 030ffb8..0b550c4 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -162,7 +162,7 @@ impl Router {
pub fn mount<R>(
&mut self,
route: impl Into<String> + AsRef<str>,
- mut handler: impl FnMut(RouteContext<'_>) -> R + Send + Sync + 'static,
+ mut handler: impl FnMut(RouteContext) -> R + Send + Sync + 'static,
) -> &mut Self
where
R: IntoFuture<Output = Response> + Send + 'static,
@@ -172,9 +172,9 @@ impl Router {
.routes
.insert(
route.into(),
- Arc::new(AsyncMutex::new(Box::new(
- move |context: RouteContext<'_>| handler(context).into_future(),
- ))),
+ Arc::new(AsyncMutex::new(Box::new(move |context: RouteContext| {
+ handler(context).into_future()
+ }))),
)
.unwrap();
@@ -375,7 +375,7 @@ impl Router {
let route_context = RouteContext::new(
stream.get_ref().peer_addr(),
url.clone(),
- route.params.clone(),
+ &route.params,
peer_certificate,
);