-
Notifications
You must be signed in to change notification settings - Fork 85
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
Rewrite and test the Bundle derive macro #104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great! No serious issues, though if you want to rewrite the history a bit we could rebase rather than squashing and keep history a little more discrete.
though I guess unit structs are kind of pointless to use?
I could imagine them coming up occasionally with feature-gated or macro-generated component fields. Definitely worth supporting, given that it's not hugely difficult to do so.
macros/src/lib.rs
Outdated
.as_ptr(); | ||
)* | ||
Ok(Self { #( #fields: #fields.read(), )* }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having two code paths here, could we resolve the issue with type annotations?
Alright, the history should be cleaner now |
|
This PR adds tests for the derive macro, makes it hygienic and fixes it not working for tuple structs and unit structs(though I guess unit structs are kind of pointless to use?).
I wanted to tackle adding generics but figured adding proper testing first would make more sense.