enum-as-inner icon indicating copy to clipboard operation
enum-as-inner copied to clipboard

Fix `is_*` methods to avoid unused variable warnings on nightly

Open rwestphal opened this issue 4 months ago • 3 comments

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.

rwestphal avatar Oct 17 '25 17:10 rwestphal

Currently, with this code:

#[derive(EnumAsInner)]
pub enum Foo {
    Bar { num: u32 },
}

the following warning occurs on nightly:

warning: value assigned to `num` is never read
   --> holo-bgp/src/packet/message.rs:130:11
    |
130 |     Bar { num: u32 },
    |           ^^^
    |
    = help: maybe it is overwritten before being read?

This PR fixes that.

rwestphal avatar Oct 17 '25 17:10 rwestphal

ping?

rwestphal avatar Dec 03 '25 02:12 rwestphal

With rust 1.92.0 this is no longer nightly only. I've tried out this branch and everything still works so I would love to see this in a new version

codewing avatar Dec 16 '25 13:12 codewing