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

Implement variant-specific attributes #27

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

michaelsproul
Copy link
Member

This PR adds support for applying different attributes to each variant. I want this primarily to integrate with a new library I'm working on, metastruct, which could be used to generate field mapping macros for superstruct variant structs. Each macro needs a unique name, so we need to make a different metastruct call for each variant.

There's an example of metastruct usage here: https://github.com/sigp/metastruct/blob/662cde78840c6cdfd6e688c155b87c6b4f1300d2/examples/hello_world.rs#L3-L6

@michaelsproul michaelsproul merged commit efac781 into main Dec 6, 2022
@michaelsproul michaelsproul deleted the specific_variant_attributes branch December 6, 2022 00:25
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