From 092b051bfe3a1b56d463d5b0c8d3b8c4d820e2ee Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 17 Oct 2025 14:39:40 -0300 Subject: [PATCH] Fix `is_*` methods to avoid unused variable warnings on nightly The `EnumAsInner` derive previously bound all fields in `is_*` methods, triggering `unused_assignments` warnings on nightly Rust. Update patterns to `{ .. }` (named) and `(..)` (unnamed) so fields are ignored while preserving behavior. Signed-off-by: Renato Westphal --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 51b0948..eee174e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -171,7 +171,7 @@ fn unnamed_fields_return( #[inline] #[allow(unused_variables)] pub fn #function_name_is(&self) -> bool { - matches!(self, Self::#variant_name(#matches)) + matches!(self, Self::#variant_name(..)) } #[doc = #doc_mut_ref ] @@ -262,7 +262,7 @@ fn named_fields_return( #[inline] #[allow(unused_variables)] pub fn #function_name_is(&self) -> bool { - matches!(self, Self::#variant_name{ #matches }) + matches!(self, Self::#variant_name{ .. }) } #[doc = #doc_mut_ref ]