Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create Wrapped Struct types #4

Open
vinaychandra opened this issue Apr 27, 2021 · 1 comment
Open

Feature Request: Create Wrapped Struct types #4

vinaychandra opened this issue Apr 27, 2021 · 1 comment

Comments

@vinaychandra
Copy link

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

@azriel91
Copy link
Owner

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

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

No branches or pull requests

2 participants