aboutsummaryrefslogtreecommitdiff
path: root/src/handler/partial.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-14 09:15:50 +0000
committerFuwn <[email protected]>2026-04-14 09:15:50 +0000
commit43092b1cdfd6e1321fb5cf4ca7d50fa5c25d04f1 (patch)
treec56dfcab5b666b602b32aed0f5f651e84ee64ea6 /src/handler/partial.rs
parentperf(context)!: Replace HashMap parameters with Parameters newtype backed by Vec (diff)
downloadarchived-windmark-43092b1cdfd6e1321fb5cf4ca7d50fa5c25d04f1.tar.xz
archived-windmark-43092b1cdfd6e1321fb5cf4ca7d50fa5c25d04f1.zip
perf(router)!: Pass RouteContext by reference to Partial headers and footers
Diffstat (limited to 'src/handler/partial.rs')
-rw-r--r--src/handler/partial.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handler/partial.rs b/src/handler/partial.rs
index b8f4057..a52fa59 100644
--- a/src/handler/partial.rs
+++ b/src/handler/partial.rs
@@ -2,11 +2,11 @@ use crate::context::RouteContext;
#[allow(clippy::module_name_repetitions)]
pub trait Partial: Send + Sync {
- fn call(&mut self, context: RouteContext) -> String;
+ fn call(&mut self, context: &RouteContext) -> String;
}
impl<T> Partial for T
-where T: FnMut(RouteContext) -> String + Send + Sync
+where T: FnMut(&RouteContext) -> String + Send + Sync
{
- fn call(&mut self, context: RouteContext) -> String { (*self)(context) }
+ fn call(&mut self, context: &RouteContext) -> String { (*self)(context) }
}