jprochazk / garde

A powerful validation library for Rust
Apache License 2.0
455 stars 27 forks source link

feat: support `equal` for length and range rules #122

Closed Rolv-Apneseth closed 2 months ago

Rolv-Apneseth commented 2 months ago

Hey, just trying to tackle #41

I'm a bit out of my depth here so please let me know if I missed something / did something wrong.

Also perhaps the section with match (range.span, range.min, range.max, range.equal) could be refactored, what do you think?

Rolv-Apneseth commented 2 months ago

Want me to try fix the cargo deny stuff on this branch or would you rather another PR to handle that so it can fix it for both this and #123 after a rebase/merge?

jprochazk commented 2 months ago

You can leave that be, I'll fix it later on main

Rolv-Apneseth commented 2 months ago

Alright

Rolv-Apneseth commented 2 months ago

Thanks for taking a look at this! I have some nitpicks, and this needs a few more tests.

Thanks for the review - I've made some more changes there, let me know if I've done anything wrong or you need some more tests

Rolv-Apneseth commented 2 months ago

No problem

Rolv-Apneseth commented 2 months ago

As a potential feature, what do you think of a rule for disallowing trailing/leading white space in strings?