From 93af23a970dbe56dc55347e2edb02a576e52db11 Mon Sep 17 00:00:00 2001 From: Thomas Versteeg Date: Sat, 15 Mar 2025 14:24:09 +0000 Subject: [PATCH] feat: allow closures for `shell` parameter in `file_and_error_handler*` (#3711) --- integrations/axum/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index 9ce580131..bba1d9979 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -2013,7 +2013,7 @@ where #[cfg(feature = "default")] pub fn file_and_error_handler_with_context( additional_context: impl Fn() + 'static + Clone + Send, - shell: fn(LeptosOptions) -> IV, + shell: impl Fn(LeptosOptions) -> IV + 'static + Clone + Send, ) -> impl Fn( Uri, State, @@ -2030,6 +2030,7 @@ where move |uri: Uri, State(state): State, req: Request| { Box::pin({ let additional_context = additional_context.clone(); + let shell = shell.clone(); async move { let options = LeptosOptions::from_ref(&state); let res = @@ -2073,7 +2074,7 @@ where /// simply reuse the source code of this function in your own application. #[cfg(feature = "default")] pub fn file_and_error_handler( - shell: fn(LeptosOptions) -> IV, + shell: impl Fn(LeptosOptions) -> IV + 'static + Clone + Send, ) -> impl Fn( Uri, State,