From 43092b1cdfd6e1321fb5cf4ca7d50fa5c25d04f1 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 14 Apr 2026 09:15:50 +0000 Subject: perf(router)!: Pass RouteContext by reference to Partial headers and footers --- src/handler/partial.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/handler/partial.rs') 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 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) } } -- cgit v1.2.3