enum-as-inner
enum-as-inner copied to clipboard
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.
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.
ping?
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