aboutsummaryrefslogtreecommitdiff
path: root/src/handler/response/error.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-14 09:01:04 +0000
committerFuwn <[email protected]>2026-04-14 09:01:04 +0000
commita48462a29ce0a3adbf0c132c28c61194f60d99b0 (patch)
tree3d7cda0368c2be310fb9a5bc2661ae7c9daf9c99 /src/handler/response/error.rs
parentchore(license): Relicense under MIT OR Apache-2.0 (diff)
downloadarchived-windmark-a48462a29ce0a3adbf0c132c28c61194f60d99b0.tar.xz
archived-windmark-a48462a29ce0a3adbf0c132c28c61194f60d99b0.zip
perf(router)!: Remove AsyncMutex from route and error handlers
Diffstat (limited to 'src/handler/response/error.rs')
-rw-r--r--src/handler/response/error.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handler/response/error.rs b/src/handler/response/error.rs
index 6d6df34..8303f25 100644
--- a/src/handler/response/error.rs
+++ b/src/handler/response/error.rs
@@ -5,16 +5,16 @@ use crate::{context::ErrorContext, response::Response};
#[allow(clippy::module_name_repetitions)]
#[async_trait]
pub trait ErrorResponse: Send + Sync {
- async fn call(&mut self, context: ErrorContext) -> Response;
+ async fn call(&self, context: ErrorContext) -> Response;
}
#[async_trait]
impl<T, F> ErrorResponse for T
where
- T: FnMut(ErrorContext) -> F + Send + Sync,
+ T: Fn(ErrorContext) -> F + Send + Sync,
F: std::future::Future<Output = Response> + Send + 'static,
{
- async fn call(&mut self, context: ErrorContext) -> Response {
+ async fn call(&self, context: ErrorContext) -> Response {
(*self)(context).await
}
}