Closed greyblake closed 3 months ago
Having the following code:
use nutype::nutype; #[nutype(validate(regex = "^[0-9]{3}-[0-9]{3}$"))] pub struct PhoneNumber(String); fn main() {}
without regex feature not enabled, the following error is spit out:
regex
error: Unknown validation attribute: `regex`. Possible attributes are `len_char_min`, `len_char_max`, `not_empty`, `predicate`, `regex`, `with`, `error`. --> dummy/src/main.rs:3:19 | 3 | #[nutype(validate(regex = "^[0-9]{3}-[0-9]{3}$"))] | ^^^^^
The error is confusing. Instead it should say that regex feature has to be enabled.
Having the following code:
without
regex
feature not enabled, the following error is spit out:The error is confusing. Instead it should say that
regex
feature has to be enabled.