fix: cargo doc in projects using #[server] (#476)

This commit is contained in:
Greg Johnston 2023-02-05 19:12:32 -05:00 committed by GitHub
parent 352601aa42
commit 45d4ebccd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,14 +157,14 @@ pub fn server_macro_impl(args: proc_macro::TokenStream, s: TokenStream2) -> Resu
#encoding
}
#[cfg(any(feature = "ssr", doc))]
#[cfg(feature = "ssr")]
fn call_fn(self, cx: ::leptos::Scope) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<Self::Output, ::leptos::ServerFnError>>>> {
let #struct_name { #(#field_names),* } = self;
#cx_assign_statement;
Box::pin(async move { #fn_name( #cx_fn_arg #(#field_names_2),*).await })
}
#[cfg(any(not(feature = "ssr"), doc))]
#[cfg(not(feature = "ssr"))]
fn call_fn_client(self, cx: ::leptos::Scope) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<Self::Output, ::leptos::ServerFnError>>>> {
let #struct_name { #(#field_names_3),* } = self;
Box::pin(async move { #fn_name( #cx_fn_arg #(#field_names_4),*).await })