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

Validate without context #102

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

lasantosr
Copy link
Contributor

This PR demonstrates how to avoid having to create two different traits, one with context and the other one without it.

It doesn't require the context to implement the Default trait, but if it do so it will have an additional validate function without the context, and it won't have it if the context doesn't implement the trait.

Closes #39 and closes #100.

This is a breaking change, so the minor version must be increased on the next release.

@jprochazk
Copy link
Owner

The failures are unrelated to the PR. Latest stable is 1.77.1, so it may just be time to bump the MSRV.

Copy link
Owner

@jprochazk jprochazk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the Context: Default bound to the context-less validate method only is a great idea!

@jprochazk jprochazk merged commit c9bfd13 into jprochazk:main Mar 29, 2024
3 of 5 checks passed
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.

Remove the need for &() Feedback
2 participants