From b70d7ea2acaab953e14a4e58dd639c3be3f8e0a0 Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Fri, 18 Oct 2024 20:25:34 +0300 Subject: [PATCH] Fix macro generation --- macros/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 972eab2..6629a80 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -10,7 +10,7 @@ struct InputActionOpts { #[darling(default)] accumulation: Option, #[darling(default)] - consume_input: bool, + consume_input: Option, } #[proc_macro_derive(InputAction, attributes(input_action))] @@ -33,9 +33,9 @@ pub fn input_action_derive(item: TokenStream) -> TokenStream { } else { Default::default() }; - let consume_input = if opts.consume_input { + let consume_input = if let Some(consume) = opts.consume_input { quote! { - const CONSUME_INPUT: bool = true; + const CONSUME_INPUT: bool = #consume; } } else { Default::default()