-
Notifications
You must be signed in to change notification settings - Fork 144
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
Trait validation #225
Merged
Merged
Trait validation #225
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
babd938
implemented validation trait for length
02bdd69
converted identation to spaces
5836898
changed the trait to not require HasLen
bd9e89f
added macro for generating impls
8bd86e8
implemented ValidateLength for some types
de20a94
using trait validation instead of the function
ee04dd0
added cfg for indexmap import
a77bdc9
changed trait to require length
pintariching 0790ded
Revert "changed trait to require length"
3277682
moved validation logic inside ValidateLength trait
66380b6
added trait validation for required
34c12ee
added email trait validation
ba0e745
fixed trait validation for email
090abc5
added range trait validation
63559f8
fixed range trait
9aeb298
added url trait validation
77520dc
Merge branch 'master' into trait-validation
pintariching File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like if the user wants to implement
ValidateLength
on their own type, they'd need to also implementHaLen
?Might it be simpler if
HasLen
is not involved?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo on the name and it shouldn't use
HasLen
at all. Then we can just create a macro to generate all the impls we want for each type. With this trait, HasLen doesn't exist anymore