pub fn erase_prefix(&mut self, prefix: &SliceData) -> bool {
        if self.is_empty() || (self.remaining_bits() < prefix.remaining_bits()) {
            false
        } else if prefix.is_empty() {
            true
        } else if *self == *prefix {
            self.shrink_data(0..0);
            true
        } else {
            match SliceData::common_prefix(self, prefix) {
                (_, _, Some(_)) => false, // prefix should be fully in self
                (_, Some(remainder), _) => {
                    *self = remainder;
                    true
                }
                (_, None, _) => {
                    log::warn!(target: "tvm", "unreachable in erase_prefix {} {}", self, prefix);
                    self.shrink_data(0..0);
                    true
                },
            }
        }
    }
/// returns false if prefix is not fully in self
returns false if prefix is not fully in self
returns false if prefix is not fully in self
pub fn erase_prefix(&mut self, prefix: &SliceData) -> bool {
        if self.is_empty() || (self.remaining_bits() < prefix.remaining_bits()) {
            false
        } else if prefix.is_empty() {
            true
        } else if *self == *prefix {
            self.shrink_data(0..0);
            true
        } else {
            match SliceData::common_prefix(self, prefix) {
                (_, _, Some(_)) => false, // prefix should be fully in self
                (_, Some(remainder), _) => {
                    *self = remainder;
                    true
                }
                (_, None, _) => {
                    log::warn!(target: "tvm", "unreachable in erase_prefix {} {}", self, prefix);
                    self.shrink_data(0..0);
                    true
                },
            }
        }
    }
pub fn erase_prefix ( & mut self , prefix : & SliceData ) -> bool { if self . is_empty ( ) || ( self . remaining_bits ( ) < prefix . remaining_bits ( ) ) { false } else if prefix . is_empty ( ) { true } else if * self == * prefix { self . shrink_data ( 0 .. 0 ) ; true } else { match SliceData :: common_prefix ( self , prefix ) { ( _ , _ , Some ( _ ) ) => false , // prefix should be fully in self ( _ , Some ( remainder ) , _ ) => { * self = remainder ; true } ( _ , None , _ ) => { log :: warn ! ( target " " " " self prefix ) ; self . shrink_data ( 0 .. 0 ) ; true } , } } }
returns false if prefix is not fully in self
returns false if prefix is not fully in self
&mut self
prefix
&SliceData
&mut self
prefix
&SliceData