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

Allow trait boundaries for generic newtypes #142

Closed
greyblake opened this issue Jun 1, 2024 · 0 comments · Fixed by #145
Closed

Allow trait boundaries for generic newtypes #142

greyblake opened this issue Jun 1, 2024 · 0 comments · Fixed by #145
Assignees

Comments

@greyblake
Copy link
Owner

greyblake commented Jun 1, 2024

The following type must be possible to declare:

#[nutype(
    sanitize(with = |v| { v.sort(); v }),
    derive(Debug)
)]
struct SortedVec<T: Ord>(Vec<T>)
  • Make sure to have a proper test coverage
    • without validation
    • with validation
  • Make sure Serialize and Deserialize can be derived
  • Add the example to the README and docs
  • Add the example to any_generics example project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant