Function range_set::range_compare::intersection
[−]
[src]
pub fn intersection<T: PrimInt>(
left: &RangeInclusive<T>,
right: &RangeInclusive<T>
) -> RangeInclusive<T>
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!(is_empty (&intersection (&(0..=2), &(3..=5))));