Keats / validator

Simple validation for Rust structs
MIT License
2.07k stars 151 forks source link

Consider alternative implementation for email validation #336

Open spotlesscoder opened 4 months ago

spotlesscoder commented 4 months ago

I find this kind of implementation more straight forward than the current one https://github.com/apache/commons-validator/blob/master/src/main/java/org/apache/commons/validator/routines/EmailValidator.java

also, this could be re-used in the sense to have a "domain" validator (they use a separate validator to validate the email's domain part that could also be used to validate a domain string on it's own) also, they provide a lot of test cases you might want to add to your tests as well: https://github.com/apache/commons-validator/blob/master/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java#L56

Keats commented 4 months ago

I kind of like matching the HTML validation, what would we get by changing the implementation?