Skip to content

Conversation

@rwestphal
Copy link

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.

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 <[email protected]>
@rwestphal
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant