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/33/derive enum variants #34
Merged
Peternator7
merged 20 commits into
Peternator7:master
from
azriel91:feature/33/derive-enum-variants
Sep 26, 2018
Merged
Feature/33/derive enum variants #34
Peternator7
merged 20 commits into
Peternator7:master
from
azriel91:feature/33/derive-enum-variants
Sep 26, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
azriel91
force-pushed
the
feature/33/derive-enum-variants
branch
from
September 19, 2018 21:34
429040a
to
0091ac7
Compare
Solved the issue I hit earlier and added docs, phew. Also allow the user to rename the generated enum. |
okay, finally got this working: #[strum_discriminants(
// These attributes are specifically looked for
name(MyVariants),
derive(EnumIter, ToString),
// --- Any additional attributes are passed through to the derived enum
strum(serialize = "snake_case"),
)]
enum MyEnum { A }
// generates
#[derive(Clone, Copy, Debug, PartialEq, Eq, EnumIter, ToString)]
#[strum(serialize = "snake_case")]
enum MyVariants { A } |
azriel91
force-pushed
the
feature/33/derive-enum-variants
branch
from
September 20, 2018 07:28
ab2751a
to
236f41d
Compare
azriel91
force-pushed
the
feature/33/derive-enum-variants
branch
from
September 24, 2018 02:15
44087a9
to
58ce968
Compare
azriel91
force-pushed
the
feature/33/derive-enum-variants
branch
from
September 24, 2018 09:08
58ce968
to
f92a81a
Compare
Peternator7
reviewed
Sep 25, 2018
Changes available on crates.io :) Thanks for all your help on this!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented #33.
there's an error that I can't work out, see commitFixed it.429040a
, uncommenting that code causes the compiler to panic (it doesn't find thestrum
attribute, even though it's clearly defined).This branch was branched off #32, so it's a bit noisy from that.