From 23bc892a24fca39eb1934ede36b1e98437e24620 Mon Sep 17 00:00:00 2001 From: Marc-Stefan Cassola Date: Fri, 16 Feb 2024 01:20:41 +0000 Subject: [PATCH] fix: `#[server]` macro error type detection (#2298) In most cases when you return `Result<..., ServerFnError>` this worked but when you tried `Result<..., leptos::ServerFnError>` then it didn't. --- server_fn_macro/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index e17d489c8..613987aa4 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -638,7 +638,7 @@ fn err_type(return_ty: &Type) -> Result> { { if let Some(segment) = pat.path.segments.last() { if segment.ident == "ServerFnError" { - let args = &pat.path.segments[0].arguments; + let args = &segment.arguments; match args { // Result PathArguments::None => return Ok(None),