enum_variant_type
enum_variant_type copied to clipboard
Feature Request: Create Wrapped Struct types
Currently, the crate only creates a new types and provides conversion methods to the enum. I think it would be advantageous to convert even the struct variants to contain the struct.
pub enum SomeEnum { variant1 { field_1 ..} }
->
pub struct Variant1 {field_1...}
pub enum SomeEnum { variant1(Variant1) }
This would allow borrows of the inner fields directly as well. An example is where we have a &SomeEnum
and we want a &Variant1
nod nod; I use that pattern as well in lieu of the RFC.
I can do that (probably part of a configuration option), but it would have to wait until late next week -- there's something else I have to finish first. Feel free to open a PR as well if you like