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

Delegate newtype EOC #163

Merged
merged 3 commits into from
Sep 28, 2023
Merged

Conversation

orthecreedence
Copy link
Contributor

So, this one is probably controversial since it likely constitutes a breaking change. This is basically me scratching an itch with #161.

The scenario is explained in the linked issue, basically I want

Newtype3(Newtype2(Newtype1(ComplexType)))

where each of the Newtypes has #[rasn(delegate)] set in the derive macro to directly serialize as ComplexType. I added some tests with this PR as well.

If this doesn't get accepted I won't be hurt, but I would like to have some kind of way of doing the above because it's becoming very common for me to wrap some none-rasn-serializable value in another library with a Newtype(SomeForeignType) and I don't want to have to write a bunch of serialize/deserialize stuff by hand each time.

@XAMPPRocky
Copy link
Collaborator

Thank you for your PR! Looks good to me, you just need to resolve the merge conflict, and it should be good to merge.

So, this one is probably controversial since it likely constitutes a breaking change.

A breaking change on its own is not controversial, namely we haven't released a major version yet, and secondly the only thing a major version has to do is show why it's worth making the change, and I think this PR shows that makes the behaviour more intuitive.

@XAMPPRocky
Copy link
Collaborator

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit aea08d0 into librasn:main Sep 28, 2023
68 checks passed
@github-actions github-actions bot mentioned this pull request Sep 28, 2023
@orthecreedence
Copy link
Contributor Author

Thanks for merging! This will save me a lot of effort.

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.

None yet

2 participants