range_cmp
This Rust crate provides the RangeComparable
trait on all types that
implement Ord
. This traits exposes a range_cmp
associated method
that allows comparing a value with a range of values:
use ;
assert_eq!;
assert_eq!;
assert_eq!;
Empty ranges handling
This crate does not strictly handle empty ranges, which are not mathematically comparable. In this case, range_cmp will show different behavior depending on the representation of the empty range. For instance:
assert_eq!;
assert_eq!;
assert_eq!;