diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-03 01:38:42 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-03 01:38:42 +0800 |
| commit | 88c3cbb27cc840d38e16ae8ab39c9a168a653a88 (patch) | |
| tree | ba6680d1bd4f6e0ce947a03d1684793493700557 | |
| parent | c078df6c97d13240d8f8bbaa0d86e830a5b71b4c (diff) | |
chore: use idiomatic boolean and reference patterns
| -rw-r--r-- | mingling_macros/src/attr/dispatcher_clap.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mingling_macros/src/attr/dispatcher_clap.rs b/mingling_macros/src/attr/dispatcher_clap.rs index 40f7d47..218750c 100644 --- a/mingling_macros/src/attr/dispatcher_clap.rs +++ b/mingling_macros/src/attr/dispatcher_clap.rs @@ -39,7 +39,7 @@ impl Parse for ClapOptions { error_struct = Some(value); } else if key == "help" { let value: LitBool = input.parse()?; - if value.value() == false { + if !value.value() { // help = false is allowed but does nothing help_enabled = false; } else { @@ -171,7 +171,7 @@ pub(crate) fn dispatcher_clap_attr(attr: TokenStream, item: TokenStream) -> Toke }; let dispatch_tree_entry = - get_dispatch_tree_entry(&command_name_str, dispatcher_struct, &struct_name); + get_dispatch_tree_entry(&command_name_str, dispatcher_struct, struct_name); let expanded = quote! { // Keep the original struct definition |
