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

feat: inner option support #70

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

bonofiglio
Copy link
Contributor

When working with custom validators, if the type is a container such as Vec<T> or Option<T>, the validation function will get a reference to that container instead of the underlying data. This is in contrast with built-in validators that are able to extract the type from some container types such as Option<T>.

This PR builds on top of the existing implementations for slice-like containers by adding support for Option<T> to the inner modifier.

This allows you to easily use the same validation function for T as you do for Option<T> or Vec<T>.

@jprochazk jprochazk merged commit 1c2a13f into jprochazk:main Sep 21, 2023
4 checks passed
@jprochazk
Copy link
Owner

Thanks!

@jprochazk
Copy link
Owner

Released in v0.16

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.

2 participants