diff options
Diffstat (limited to 'src/handler')
| -rw-r--r-- | src/handler/partial.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/handler/partial.rs b/src/handler/partial.rs index 1d55b93..aa433e1 100644 --- a/src/handler/partial.rs +++ b/src/handler/partial.rs @@ -18,6 +18,13 @@ use crate::context::RouteContext; -pub trait Partial: FnMut(RouteContext) -> String + Send + Sync {} +#[allow(clippy::module_name_repetitions)] +pub trait Partial: Send + Sync { + fn call(&mut self, context: RouteContext) -> String; +} -impl<T> Partial for T where T: FnMut(RouteContext) -> String + Send + Sync {} +impl<T> Partial for T +where T: FnMut(RouteContext) -> String + Send + Sync +{ + fn call(&mut self, context: RouteContext) -> String { (*self)(context) } +} |