aboutsummaryrefslogtreecommitdiff
path: root/src/handler
diff options
context:
space:
mode:
Diffstat (limited to 'src/handler')
-rw-r--r--src/handler/hooks/post_route.rs6
-rw-r--r--src/handler/hooks/pre_route.rs6
-rw-r--r--src/handler/partial.rs6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/handler/hooks/post_route.rs b/src/handler/hooks/post_route.rs
index 1e1a6b6..0a6e6b7 100644
--- a/src/handler/hooks/post_route.rs
+++ b/src/handler/hooks/post_route.rs
@@ -2,13 +2,13 @@ use crate::{context::HookContext, response::Response};
#[allow(clippy::module_name_repetitions)]
pub trait PostRouteHook: Send + Sync {
- fn call(&mut self, context: &HookContext, response: &mut Response);
+ fn call(&self, context: &HookContext, response: &mut Response);
}
impl<T> PostRouteHook for T
-where T: FnMut(&HookContext, &mut Response) + Send + Sync
+where T: Fn(&HookContext, &mut Response) + Send + Sync
{
- fn call(&mut self, context: &HookContext, response: &mut Response) {
+ fn call(&self, context: &HookContext, response: &mut Response) {
(*self)(context, response);
}
}
diff --git a/src/handler/hooks/pre_route.rs b/src/handler/hooks/pre_route.rs
index 1d11d66..322969c 100644
--- a/src/handler/hooks/pre_route.rs
+++ b/src/handler/hooks/pre_route.rs
@@ -2,11 +2,11 @@ use crate::context::HookContext;
#[allow(clippy::module_name_repetitions)]
pub trait PreRouteHook: Send + Sync {
- fn call(&mut self, context: &HookContext);
+ fn call(&self, context: &HookContext);
}
impl<T> PreRouteHook for T
-where T: FnMut(&HookContext) + Send + Sync
+where T: Fn(&HookContext) + Send + Sync
{
- fn call(&mut self, context: &HookContext) { (*self)(context) }
+ fn call(&self, context: &HookContext) { (*self)(context) }
}
diff --git a/src/handler/partial.rs b/src/handler/partial.rs
index a52fa59..a552096 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(&self, context: &RouteContext) -> String;
}
impl<T> Partial for T
-where T: FnMut(&RouteContext) -> String + Send + Sync
+where T: Fn(&RouteContext) -> String + Send + Sync
{
- fn call(&mut self, context: &RouteContext) -> String { (*self)(context) }
+ fn call(&self, context: &RouteContext) -> String { (*self)(context) }
}