-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat(derive): Introduce flatten attribute #118
Conversation
87f0b7e
to
e42a284
Compare
If I am not mistaken, |
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.
Great work. Thanks @howardjohn. I have a couple of questions and comments. Overall this looks good to me.
We can release this as a patch release. Would you mind bumping the patch version in derive-encode/Cargo.toml
and provide a changelog entry in CHANGELOG.md
?
5d1023c
to
9860e05
Compare
Signed-off-by: John Howard <[email protected]>
Signed-off-by: John Howard <[email protected]>
Signed-off-by: John Howard <[email protected]>
3d13bcd
to
563459a
Compare
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.
Wonderful. Thanks for the follow-up. One more thing for the changelog. Otherwise this is ready to go. Happy to cut a release right once this is merged.
For legal reasons you need to add a |
Signed-off-by: John Howard <[email protected]>
df54834
to
f49e40a
Compare
No problem, updated |
Signed-off-by: Max Inden <[email protected]>
Signed-off-by: Max Inden <[email protected]>
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 for the contribution! Thanks for bearing with me.
Fixes #117
This introduces a new attribute to the derive code for to flatten. This matches https://serde.rs/attr-flatten.html.
This seems to work, but I have some concern that if there are duplicate fields we end up encoding all of them which may make things go awry. Checking this is hard since we would need to lookup the type, which I am not sure how to do...