fn remove_internal(&mut self, range: Range<usize>) -> Cow<'event, [u8]> {
        self.section
            .0
            .drain(range)
            // TODO: replace with Iterator::reduce once that hits stable
            .fold(Cow::<[u8]>::Owned(vec![]), |acc, e| match e {
                Event::Value(v) | Event::ValueNotDone(v) | Event::ValueDone(v) => {
                    // This is fine because we start out with an owned
                    // variant, so we never actually clone the
                    // accumulator.
                    let mut acc = acc.into_owned();
                    acc.extend(&*v);
                    Cow::Owned(acc)
                }
                _ => acc,
            })
    }
/// Performs the removal, assuming the range is valid. This is used to
/// avoid duplicating searching for the range in [`Self::set`].
Performs the removal, assuming the range is valid. This is used to
avoid duplicating searching for the range in [`Self::set`].
Performs the removal assuming the range is valid . This is used to avoid duplicating searching for the range in [ ` Self :: set ` ] .
fn remove_internal(&mut self, range: Range<usize>) -> Cow<'event, [u8]> {
        self.section
            .0
            .drain(range)
            // TODO: replace with Iterator::reduce once that hits stable
            .fold(Cow::<[u8]>::Owned(vec![]), |acc, e| match e {
                Event::Value(v) | Event::ValueNotDone(v) | Event::ValueDone(v) => {
                    // This is fine because we start out with an owned
                    // variant, so we never actually clone the
                    // accumulator.
                    let mut acc = acc.into_owned();
                    acc.extend(&*v);
                    Cow::Owned(acc)
                }
                _ => acc,
            })
    }
fn remove_internal ( & mut self , range : Range < usize > ) -> Cow < ' event , [ u8 ] > { self . section . 0 . drain ( range ) // TODO: replace with Iterator::reduce once that hits stable . fold ( Cow :: < [ u8 ] > :: Owned ( vec ! [ ] ) , | acc , e | match e { Event :: Value ( v ) | Event :: ValueNotDone ( v ) | Event :: ValueDone ( v ) => { // This is fine because we start out with an owned // variant, so we never actually clone the // accumulator. let mut acc = acc . into_owned ( ) ; acc . extend ( & * v ) ; Cow :: Owned ( acc ) } _ => acc , } ) }
Performs the removal, assuming the range is valid.
Performs the removal assuming the range is valid .
&mut self
range
Range<usize>