enum_variant_type icon indicating copy to clipboard operation
enum_variant_type copied to clipboard

Feature Request: Create Wrapped Struct types

Open vinaychandra opened this issue 3 years ago • 1 comments

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

vinaychandra avatar Apr 27 '21 03:04 vinaychandra

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

azriel91 avatar Apr 27 '21 06:04 azriel91