From e706a69139cbb72f6b6fefec0b554339f28a8517 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Tue, 19 Sep 2023 08:48:47 +0800 Subject: [PATCH] chore(server_fn_macro): improve docs (#1733) --- server_fn_macro/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index 4e0c6b7c9..f40471e16 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -1,9 +1,10 @@ #![cfg_attr(feature = "nightly", feature(proc_macro_span))] #![forbid(unsafe_code)] #![deny(missing_docs)] -//! Implementation of the server_fn macro. + +//! Implementation of the `server_fn` macro. //! -//! This crate contains the implementation of the server_fn macro. [server_macro_impl] can be used to implement custom versions of the macro for different frameworks that allow users to pass a custom context from the server to the server function. +//! This crate contains the implementation of the `server_fn` macro. [`server_macro_impl`] can be used to implement custom versions of the macro for different frameworks that allow users to pass a custom context from the server to the server function. use proc_macro2::{Literal, Span, TokenStream as TokenStream2}; use proc_macro_error::abort; @@ -39,7 +40,7 @@ fn fn_arg_is_cx(f: &syn::FnArg, server_context: &ServerContext) -> bool { } } -/// The implementation of the server_fn macro. +/// The implementation of the `server_fn` macro. /// To allow the macro to accept a custom context from the server, pass a custom server context to this function. /// **The Context comes from the server.** Optionally, the first argument of a server function /// can be a custom context. This context can be used to inject dependencies like the HTTP request @@ -65,7 +66,6 @@ fn fn_arg_is_cx(f: &syn::FnArg, server_context: &ServerContext) -> bool { /// } /// } /// ``` - pub fn server_macro_impl( args: TokenStream2, body: TokenStream2,