greyblake / nutype

Rust newtype with guarantees 🇺🇦 🦀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rename error variants to have Violated postfix

greyblake opened this issue · comments

Context

With more validators on the way, we need to have a simple way for users to draw a connection between a validation rule and error variant

Spec

Rename all the validation error variants to match the following formula: <ValidationRule>Violated.

Example:

  • char_len_max is currently results into error variant TooLong. Should be CharLenMaxViolated
  • not_empty results into Empty. Should be NotEmptyViolated.

Make clippy ignore the same postfix if necessary.

Update CHANGELOG and docs in lib.rs. Don't touch README yet.