-
Notifications
You must be signed in to change notification settings - Fork 3
Add custom validation other solution #98
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
Conversation
oylenshpeegul
left a comment
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.
This looks great!
I was confused for a bit why there wasn't a change to codelist_options.rs to remove the custom regex, but of course that was just added in #97 and this bypasses that entirely.
I like how LazyLock being in the standard library means we do not have to add anything to [dev-dependencies] or whatever.
CarolineMorton
left a comment
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.
A couple of comments about tests. Well done Emma this is much simpler and easier to understand. Let's get these changes checked in and close the other PR.
CarolineMorton
left a comment
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.
Hey Emma, this looks great, thanks. Let;s get this merged in.
| codelist.add_entry("A11", "Valid test code") | ||
| codelist.validate_codes("^A") | ||
| codelist.add_entry("B112", "Invalid test code") |
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.
Awesome, thanks
Alternative method, a lot simpler.
Closes #93