We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello and thanks for the great library.
Most of the times that I use, I have something like:
#[subenum(Edible, NonEdible)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Plant { #[subenum(Edible)] Basil, #[subenum(Edible)] Tomato, #[subenum(NonEdible)] Manzanita, #[subenum(NonEdible)] Pine, }
Then I manually implement a type:
pub enum EdibleGroup { Edible(PlantEdible), NonEdible(PlantNonEdible), } // also have defined the PlantEdible and PlanNonEdible enums
And finally I can have ìmpl From<EdibleGroup> for Plant and ìmpl From<Plant> for EdibleGroup.
ìmpl From<EdibleGroup> for Plant
ìmpl From<Plant> for EdibleGroup
Is it a feature that you would consider to have builtin? The design would be something like:
#[subenum(EdibleGroup(Edible, NonEdible))] ...
I use the term exhaustive because each case must have 1 and only 1 of these Edible and NonEdible or it will error compile time.
Edible
NonEdible
And I would implement and send a pull request. Thanks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello and thanks for the great library.
Most of the times that I use, I have something like:
Then I manually implement a type:
And finally I can have
ìmpl From<EdibleGroup> for Plant
andìmpl From<Plant> for EdibleGroup
.Is it a feature that you would consider to have builtin? The design would be something like:
I use the term exhaustive because each case must have 1 and only 1 of these
Edible
andNonEdible
or it will error compile time.And I would implement and send a pull request. Thanks.
The text was updated successfully, but these errors were encountered: