Skip to content

Commit 076750d

Browse files
rwestphalbluejekyll
authored andcommitted
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 <renato@opensourcerouting.org>
1 parent 6770c8a commit 076750d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn unnamed_fields_return(
171171
#[inline]
172172
#[allow(unused_variables)]
173173
pub fn #function_name_is(&self) -> bool {
174-
matches!(self, Self::#variant_name(#matches))
174+
matches!(self, Self::#variant_name(..))
175175
}
176176

177177
#[doc = #doc_mut_ref ]
@@ -262,7 +262,7 @@ fn named_fields_return(
262262
#[inline]
263263
#[allow(unused_variables)]
264264
pub fn #function_name_is(&self) -> bool {
265-
matches!(self, Self::#variant_name{ #matches })
265+
matches!(self, Self::#variant_name{ .. })
266266
}
267267

268268
#[doc = #doc_mut_ref ]

0 commit comments

Comments
 (0)