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

New Enum Derive Type (Enum Return Groups) #386

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

SCDevel
Copy link

@SCDevel SCDevel commented Oct 21, 2024

Ok first off I made this for another project of mine that uses strum and wanted to play around with macros and avoid my other project. so I don't really plan on updating this anymore unless I run into issues with my other project. But anyways I figured you guys/girls might be interested in it so I wrote some documents and am creating this pull request.

I apologize for any "bad" code but I truly only code as a boredom/hobby thing.

Here is a TLDR of what this does. more info can be found in the lib.rs -> EnumGroups() as a doc string and playing in the tests.

TLDR:
Edit (fixed my terrible grammar):
This groups all of the variants by there arguments and generates a struct with variable for each grouped return type wrapped in a Option<T>. each variant auto implements a new .get_groups() which returns the generated struct of types; which should populated with all None except for the one that applies to the variant its called from. that result should be Some(T)

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

Successfully merging this pull request may close these issues.

1 participant