From 92c6a2a89ec90e4d91677315cbc871d0b7c8b11c Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Thu, 5 Dec 2024 21:07:44 -0500 Subject: [PATCH 1/2] fix: correctly support `!Send` Actix APIs in server functions --- server_fn_macro/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index 1e80222a8e..864cba1204 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -188,6 +188,20 @@ pub fn server_macro_impl( }) .collect::>>()?; + // we need to apply the same sort of Actix SendWrapper workaround here + // that we do for the body of the function provided in the trait (see below) + if cfg!(feature = "actix") { + let block = body.block.to_token_stream(); + body.block = quote! { + { + #server_fn_path::actix::SendWrapper::new(async move { + #block + }) + .await + } + }; + } + let dummy = body.to_dummy_output(); let dummy_name = body.to_dummy_ident(); let args = syn::parse::(args.into())?; From c4826d27b569a065963c46c741ce86e38999dc36 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 02:17:37 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 534dd84bfe..e54a4ff679 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -918,7 +918,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "either_of" -version = "0.1.0" +version = "0.1.1" dependencies = [ "pin-project-lite", ]