pub fn shrink_data<T: RangeBounds<usize>>(&mut self, range: T) -> SliceData {
        let data_len = self.remaining_bits();
        let start = match range.start_bound() {
            Bound::Included(start) => *start,
            Bound::Excluded(start) => start + 1,
            Bound::Unbounded => 0
        };
        let end = match range.end_bound() {
            Bound::Included(end) => end + 1,
            Bound::Excluded(end) => *end,
            Bound::Unbounded => data_len
        };
        if (start <= end) && (end <= data_len) {
            let mut slice = self.clone();
            if start != 0 { // return prefix
                slice.data_window.end = slice.data_window.start + start;
            } else { // return suffix
                slice.data_window.start += end;
            }
            slice.references_window = 0..0;
            self.data_window.end = self.data_window.start + end;
            self.data_window.start += start;
            slice
        } else {
            SliceData::default()
        }
    }
/// shrinks data_window: range - subrange of current window, returns prefix of suffix
shrinks data_window: range - subrange of current window, returns prefix of suffix
shrinks data_window : range - subrange of current window returns prefix of suffix
pub fn shrink_data<T: RangeBounds<usize>>(&mut self, range: T) -> SliceData {
        let data_len = self.remaining_bits();
        let start = match range.start_bound() {
            Bound::Included(start) => *start,
            Bound::Excluded(start) => start + 1,
            Bound::Unbounded => 0
        };
        let end = match range.end_bound() {
            Bound::Included(end) => end + 1,
            Bound::Excluded(end) => *end,
            Bound::Unbounded => data_len
        };
        if (start <= end) && (end <= data_len) {
            let mut slice = self.clone();
            if start != 0 { // return prefix
                slice.data_window.end = slice.data_window.start + start;
            } else { // return suffix
                slice.data_window.start += end;
            }
            slice.references_window = 0..0;
            self.data_window.end = self.data_window.start + end;
            self.data_window.start += start;
            slice
        } else {
            SliceData::default()
        }
    }
pub fn shrink_data < T : RangeBounds < usize > > ( & mut self , range : T ) -> SliceData { let data_len = self . remaining_bits ( ) ; let start = match range . start_bound ( ) { Bound :: Included ( start ) => * start , Bound :: Excluded ( start ) => start + 1 , Bound :: Unbounded => 0 } ; let end = match range . end_bound ( ) { Bound :: Included ( end ) => end + 1 , Bound :: Excluded ( end ) => * end , Bound :: Unbounded => data_len } ; if ( start <= end ) && ( end <= data_len ) { let mut slice = self . clone ( ) ; if start != 0 { // return prefix slice . data_window . end = slice . data_window . start + start ; } else { // return suffix slice . data_window . start += end ; } slice . references_window = 0 .. 0 ; self . data_window . end = self . data_window . start + end ; self . data_window . start += start ; slice } else { SliceData :: default ( ) } }
shrinks data_window: range - subrange of current window, returns prefix of suffix
shrinks data_window : range - subrange of current window returns prefix of suffix
&mut self
range
T
&mut self
range
T