Skip to content

Commit

Permalink
Prevent underscore binding lint (#216)
Browse files Browse the repository at this point in the history
This lint is triggered when we have an unused parameter in the handler function. The code that's generated copies the identifier name from the function definition, but does use the identifier, so we need to disable this lint. That said, a better solution might be to add a fixed prefix like `poise_arg_` to each parameter name.
  • Loading branch information
mattfbacon authored Nov 2, 2023
1 parent e1a5312 commit 8e917d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions macros/src/command/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub fn generate_prefix_action(inv: &Invocation) -> Result<proc_macro2::TokenStre
};

Ok(quote::quote! {
#[allow(clippy::used_underscore_binding)]
|ctx| Box::pin(async move {
let ( #( #param_idents, )* .. ) = ::poise::parse_prefix_args!(
ctx.serenity_context, ctx.msg, ctx.args, 0 =>
Expand Down

0 comments on commit 8e917d2

Please sign in to comment.