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

Made the derive macros automatically implement the required traits on generic arguments #454

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

VictorKoenders
Copy link
Contributor

Fixed #451

This PR builds upon a new function in virtue: modify_generic_constraints

The derive macros will now automatically assume any generic argument implements the required traits.

If a user is in a situation where this isn't required, a solution is:

  • They can implement the BorrowDecode/Decode/Encode manually
  • We can add a #[bincode(bounds = "T: Decode")] attribute in the future to override the current type check logic, similar to https://serde.rs/container-attrs.html#bound

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.

Add Encode/Decode/BorrowDecode constraints for struct generic type parameters in derive macro's outputs
2 participants