Skip to content

Commit

Permalink
Fix macro generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Oct 18, 2024
1 parent 6e812d1 commit b70d7ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct InputActionOpts {
#[darling(default)]
accumulation: Option<Ident>,
#[darling(default)]
consume_input: bool,
consume_input: Option<bool>,
}

#[proc_macro_derive(InputAction, attributes(input_action))]
Expand All @@ -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()
Expand Down

0 comments on commit b70d7ea

Please sign in to comment.