accord icon indicating copy to clipboard operation
accord copied to clipboard

Find a better way to use RangeInclusive

Open ChrisBuchholz opened this issue 8 years ago • 2 comments

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.

ChrisBuchholz avatar Jan 20 '17 07:01 ChrisBuchholz

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.

tcmal avatar Jul 15 '18 10:07 tcmal

Inclusive range is in stable now (1.26.0) so we can use it, contains & stuff are basically just convenience.

tcmal avatar Jul 15 '18 11:07 tcmal