Function range_difference

Source
pub fn range_difference<T: Ord + Copy>(
    a: &Range<T>,
    b: &Range<T>,
) -> impl Iterator<Item = Range<T>>
Expand description

Calculates the difference of two Ranges, i.e., a - b.

This method will return 0, 1, or 2 ranges. All returned ranges are guaranteed to be non-empty and non-overlapping. The returned ranges will be sorted in ascending order.