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

derive(Deref) with generic boundaries does not compile #157

Closed
greyblake opened this issue Jul 6, 2024 · 0 comments · Fixed by #158
Closed

derive(Deref) with generic boundaries does not compile #157

greyblake opened this issue Jul 6, 2024 · 0 comments · Fixed by #158
Labels
bug Something isn't working

Comments

@greyblake
Copy link
Owner

The following should work:

#[nutype(
    sanitize(with = |mut v| { v.sort(); v }),
    validate(predicate = |vec| !vec.is_empty()),
    derive(Debug, PartialEq, Deref),
)]
struct SortedNotEmptyVec<T: Ord>(Vec<T>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant