accord
accord copied to clipboard
Find a better way to use RangeInclusive
The patter used to implement length
and range
validators using RangeInclusive
is ugly; especially the panic here: https://github.com/ChrisBuchholz/accord/blob/master/src/validators.rs#L74
Find a better way.
The easiest way on nightly would be to use Range::contains()
but that's experimental right now. It should probably default to false if the range is invalid.
Inclusive range is in stable now (1.26.0) so we can use it, contains & stuff are basically just convenience.