pub fn intersection<T: PrimInt>(
    left: &RangeInclusive<T>,
    right: &RangeInclusive<T>
) -> RangeInclusive<T>
Expand description

Compute the intersection of two inclusive ranges. Returns an empty range if they are disjoint.

assert_eq!(intersection (&(0..=3), &(2..=5)), 2..=3);
assert!(intersection (&(0..=2), &(3..=5)).is_empty());