-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add EnumCount derive #15
Comments
This makes sense to me. Would you be willing to make the changes and submit a PR? Once rust-lang/rfcs#911 is stablized, we can make |
I also need this feature too. I will try to make PR. |
Dushistov
added a commit
to Dushistov/strum
that referenced
this issue
Oct 29, 2018
Peternator7
pushed a commit
that referenced
this issue
Nov 5, 2018
* feature: add enum count macros fix #15 * add docs for EnumCount
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this proc-macro because I needed it (for mapping Enum cases from different enums to Vec regions, making the Vec len equal to the combined number of all cases) and I think it would make sense to include it in this crate, because it already contains many useful derives for enums.
https://github.com/Boscop/enum-count/blob/master/src/lib.rs
https://github.com/Boscop/enum-count-derive/blob/master/src/lib.rs
It allows stuff like this:
(The constant is necessary for it to be used in other enums and static array lens etc.)
The text was updated successfully, but these errors were encountered: