summaryrefslogtreecommitdiff
path: root/mingling_macros/src/lib.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-29 01:18:25 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-29 01:18:25 +0800
commit7809a8cbfbaf41fcc81de980c903e11f08bd1b12 (patch)
tree1ae5d274530fa73af768146b955d183b94eb2a0a /mingling_macros/src/lib.rs
parentdb9afa0b06355028eafe3bc29fe0b2429ba8fd0a (diff)
Generate struct names from function names in chain and renderer macros
Diffstat (limited to 'mingling_macros/src/lib.rs')
-rw-r--r--mingling_macros/src/lib.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs
index b32534b..26a7381 100644
--- a/mingling_macros/src/lib.rs
+++ b/mingling_macros/src/lib.rs
@@ -121,8 +121,8 @@ pub fn r_println(input: TokenStream) -> TokenStream {
/// ```ignore
/// use mingling_macros::chain;
///
-/// #[chain(InitEntry)]
-/// pub async fn proc(_: InitBegin) -> mingling::ChainProcess {
+/// #[chain]
+/// pub async fn init_entry(_: InitBegin) -> mingling::ChainProcess {
/// AnyOutput::new::<InitResult>("Init!".to_string().into()).route_chain()
/// }
/// ```
@@ -138,8 +138,8 @@ pub fn r_println(input: TokenStream) -> TokenStream {
/// }
/// ```
#[proc_macro_attribute]
-pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream {
- chain::chain_attr(attr, item)
+pub fn chain(_attr: TokenStream, item: TokenStream) -> TokenStream {
+ chain::chain_attr(item)
}
/// Attribute macro for automatically generating structs that implement the `Renderer` trait.
@@ -152,8 +152,8 @@ pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream {
/// ```ignore
/// use mingling_macros::renderer;
///
-/// #[renderer(InitResultRenderer)]
-/// fn render(p: InitResult) {
+/// #[renderer]
+/// fn init_result_render(p: InitResult) {
/// let str: String = p.into();
/// r_println!("{}", str);
/// }
@@ -161,8 +161,8 @@ pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream {
///
/// This generates:
/// ```ignore
-/// pub struct InitResultRenderer;
-/// impl Renderer for InitResultRenderer {
+/// pub struct InitResultRender;
+/// impl Renderer for InitResultRender {
/// type Previous = InitResult;
///
/// fn render(p: Self::Previous, r: &mut RenderResult) {
@@ -172,8 +172,8 @@ pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream {
/// }
/// ```
#[proc_macro_attribute]
-pub fn renderer(attr: TokenStream, item: TokenStream) -> TokenStream {
- renderer::renderer_attr(attr, item)
+pub fn renderer(_attr: TokenStream, item: TokenStream) -> TokenStream {
+ renderer::renderer_attr(item)
}
/// Macro for creating a program structure that collects all chains and renderers.