diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-05-24 17:18:18 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-24 17:18:48 +0800 |
| commit | 0d3639016ac89ca3c6d7a8d2c8aa3b7656069e4e (patch) | |
| tree | b3b323eb3031fcafc65197dd65d41b693e70b859 /mingling_macros/src/lib.rs | |
| parent | 60e70f5320b2abdb38a2349c18e5bffcfea37ca7 (diff) | |
Gate extra_macros items behind the feature flag
Diffstat (limited to 'mingling_macros/src/lib.rs')
| -rw-r--r-- | mingling_macros/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs index 73f2fa5..60fe428 100644 --- a/mingling_macros/src/lib.rs +++ b/mingling_macros/src/lib.rs @@ -33,12 +33,14 @@ mod dispatch_tree_gen; mod dispatcher; #[cfg(feature = "clap")] mod dispatcher_clap; +#[cfg(feature = "extra_macros")] mod entry; mod enum_tag; mod groupped; mod help; mod node; mod pack; +#[cfg(feature = "extra_macros")] mod program_setup; mod render; mod renderer; @@ -224,6 +226,7 @@ pub fn pack(input: TokenStream) -> TokenStream { /// value /// } /// ``` +#[cfg(feature = "extra_macros")] #[proc_macro] pub fn route(input: TokenStream) -> TokenStream { let expr = parse_macro_input!(input as syn::Expr); @@ -273,6 +276,7 @@ pub fn route(input: TokenStream) -> TokenStream { /// /// This works because `EmptyResult` is automatically generated by `gen_program!` /// and implements the necessary trait conversions into `ChainProcess`. +#[cfg(feature = "extra_macros")] #[proc_macro] pub fn empty_result(_input: TokenStream) -> TokenStream { let expanded = quote! { @@ -739,6 +743,7 @@ pub fn completion(attr: TokenStream, item: TokenStream) -> TokenStream { /// - The function must have exactly one parameter of type `&mut Program<G>`. /// - The function must return `()`. /// - The function cannot be async. +#[cfg(feature = "extra_macros")] #[proc_macro_attribute] pub fn program_setup(attr: TokenStream, item: TokenStream) -> TokenStream { program_setup::setup_attr(attr, item) @@ -815,6 +820,7 @@ pub fn dispatcher_clap(attr: TokenStream, item: TokenStream) -> TokenStream { /// /// This is a convenience macro for constructing entry wrapper types (created /// via `pack!` or `dispatcher!`) with test data. +#[cfg(feature = "extra_macros")] #[proc_macro] pub fn entry(input: TokenStream) -> TokenStream { entry::entry(input) |
