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(AsRef) with generic boundaries is not compiling #156

Closed
greyblake opened this issue Jul 6, 2024 · 1 comment
Closed

derive(AsRef) with generic boundaries is not compiling #156

greyblake opened this issue Jul 6, 2024 · 1 comment
Assignees
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, AsRef),
)]
struct SortedNotEmptyVec<T: Ord>(Vec<T>);
@greyblake greyblake added the bug Something isn't working label Jul 6, 2024
@greyblake greyblake self-assigned this Jul 6, 2024
@greyblake
Copy link
Owner Author

Fixed in #158

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

No branches or pull requests

1 participant