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

Custom derive #12

Open
Michael-F-Bryan opened this issue Aug 11, 2017 · 3 comments
Open

Custom derive #12

Michael-F-Bryan opened this issue Aug 11, 2017 · 3 comments

Comments

@Michael-F-Bryan
Copy link

Now that custom derives are stable, would this be better done using them instead of a macro_rules macro? That way you can have the FromPrimitive and ToPrimitive trait definitions in enum_primitive and then a enum_primitive_derive crate to do the deriving.

I think something like this is more applicable to macros 1.1 than macros by example, and that way you also fix up long-standing issues like being unable to document each variant.

@cardoe
Copy link

cardoe commented Aug 30, 2017

fwiw, I've got one published at https://crates.io/crates/enum-primitive-derive

@cardoe
Copy link

cardoe commented May 30, 2020

If the author of the crate would give me access to the enum-primitive crate then I'll wrap it all up in a nice bow like serde and serde_derive.

@Michael-F-Bryan
Copy link
Author

@cardoe, can't you just create a pull request? They shouldn't need to give you permissions to the GitHub repo or crates.io package just so you can add a change.

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