fn range_size(range: &impl RangeBounds<u64>) -> impl Fn(u64) -> u64 {
    let end = match range.end_bound() {
        Bound::Unbounded => None,
        Bound::Included(x) => Some(*x),
        Bound::Excluded(x) => Some(*x - 1),
    };
    let start = match range.start_bound() {
        Bound::Unbounded => 0,
        Bound::Included(x) => *x,
        Bound::Excluded(x) => *x + 1,
    };

    move |true_end| end.unwrap_or(true_end) - start
}
/// Returns a closure which computes a range's size given a expected end-bound
Returns a closure which computes a range's size given a expected end-bound
Returns a closure which computes a range ' s size given a expected end - bound
fn range_size(range: &impl RangeBounds<u64>) -> impl Fn(u64) -> u64 {
    let end = match range.end_bound() {
        Bound::Unbounded => None,
        Bound::Included(x) => Some(*x),
        Bound::Excluded(x) => Some(*x - 1),
    };
    let start = match range.start_bound() {
        Bound::Unbounded => 0,
        Bound::Included(x) => *x,
        Bound::Excluded(x) => *x + 1,
    };
    move |true_end| end.unwrap_or(true_end) - start
}
fn range_size ( range : & impl RangeBounds < u64 > ) -> impl Fn ( u64 ) -> u64 { let end = match range . end_bound ( ) { Bound :: Unbounded => None , Bound :: Included ( x ) => Some ( * x ) , Bound :: Excluded ( x ) => Some ( * x - 1 ) , } ; let start = match range . start_bound ( ) { Bound :: Unbounded => 0 , Bound :: Included ( x ) => * x , Bound :: Excluded ( x ) => * x + 1 , } ; move | true_end | end . unwrap_or ( true_end ) - start }
Returns a closure which computes a range's size given a expected end-bound
Returns a closure which computes a range ' s size given a expected end - bound
range
&impl RangeBounds<u64>
range
&impl RangeBounds<u64>