/// Create range covering the overlap between two ranges, or None if
/// there is no overlap.
Create range covering the overlap between two ranges, or None if
there is no overlap.
Create range covering the overlap between two ranges or None if there is no overlap .
pub fn range_clamp<T: Copy + PartialOrd + Sub<Output=T>>
    (a: InclusiveRange<T>, b: InclusiveRange<T>)
     -> Option<InclusiveRange<T>> {
    let min = pomax(a.min, b.min);
    let max = pomin(a.max, b.max);
    if min <= max {
        Some(InclusiveRange::new(min, max))
    }
    else {
        None
    }
}
pub fn range_clamp < T : Copy + PartialOrd + Sub < Output = T > > ( a : InclusiveRange < T > , b : InclusiveRange < T > ) -> Option < InclusiveRange < T > > { let min = pomax ( a . min , b . min ) ; let max = pomin ( a . max , b . max ) ; if min <= max { Some ( InclusiveRange :: new ( min , max ) ) } else { None } }
Create range covering the overlap between two ranges, or None if
there is no overlap.
Create range covering the overlap between two ranges or None if there is no overlap .
a
InclusiveRange<T>
b
InclusiveRange<T>