pub fn remove<'a, K: Into<Key<'a>>>(&mut self, k: K) -> Option<Value> {
        match k.into() {
            Key::BoolCap(k) => {
                if let Some((i, _)) = self.bools.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.bools.remove(i).1)
                } else {
                    None
                }
            }
            Key::IntCap(k) => {
                if let Some((i, _)) = self.ints.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.ints.remove(i).1)
                } else {
                    None
                }
            }
            Key::StrCap(k) => {
                if let Some((i, _)) = self.strs.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.strs.remove(i).1)
                } else {
                    None
                }
            }
            Key::Name(k) => match self.ex.remove(k) {
                v @ Some(BooleanValue(_)) => {
                    if let Some((i, _)) = self.ex_bools.iter().enumerate().find(|(_, ek)| ek == &k)
                    {
                        self.ex_bools.remove(i);
                    }
                    v
                }
                v @ Some(IntegerValue(_)) => {
                    if let Some((i, _)) = self.ex_nums.iter().enumerate().find(|(_, ek)| ek == &k) {
                        self.ex_nums.remove(i);
                    }
                    v
                }
                v @ Some(StringValue(_)) => {
                    if let Some((i, _)) = self.ex_strs.iter().enumerate().find(|(_, ek)| ek == &k) {
                        self.ex_strs.remove(i);
                    }
                    v
                }
                _ => None,
            },
        }
    }
/// Remove a value from the terminfo struct.
///
/// Returns the value that was removed, or `None` if the key wasn't found.
Remove a value from the terminfo struct.
Returns the value that was removed, or `None` if the key wasn't found.
Remove a value from the terminfo struct . Returns the value that was removed or ` None ` if the key wasn ' t found .
pub fn remove<'a, K: Into<Key<'a>>>(&mut self, k: K) -> Option<Value> {
        match k.into() {
            Key::BoolCap(k) => {
                if let Some((i, _)) = self.bools.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.bools.remove(i).1)
                } else {
                    None
                }
            }
            Key::IntCap(k) => {
                if let Some((i, _)) = self.ints.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.ints.remove(i).1)
                } else {
                    None
                }
            }
            Key::StrCap(k) => {
                if let Some((i, _)) = self.strs.iter().enumerate().find(|(_, (b, _))| b == &k) {
                    Some(self.strs.remove(i).1)
                } else {
                    None
                }
            }
            Key::Name(k) => match self.ex.remove(k) {
                v @ Some(BooleanValue(_)) => {
                    if let Some((i, _)) = self.ex_bools.iter().enumerate().find(|(_, ek)| ek == &k)
                    {
                        self.ex_bools.remove(i);
                    }
                    v
                }
                v @ Some(IntegerValue(_)) => {
                    if let Some((i, _)) = self.ex_nums.iter().enumerate().find(|(_, ek)| ek == &k) {
                        self.ex_nums.remove(i);
                    }
                    v
                }
                v @ Some(StringValue(_)) => {
                    if let Some((i, _)) = self.ex_strs.iter().enumerate().find(|(_, ek)| ek == &k) {
                        self.ex_strs.remove(i);
                    }
                    v
                }
                _ => None,
            },
        }
    }
pub fn remove < ' a , K : Into < Key < ' a > > > ( & mut self , k : K ) -> Option < Value > { match k . into ( ) { Key :: BoolCap ( k ) => { if let Some ( ( i , _ ) ) = self . bools . iter ( ) . enumerate ( ) . find ( | ( _ , ( b , _ ) ) | b == & k ) { Some ( self . bools . remove ( i ) . 1 ) } else { None } } Key :: IntCap ( k ) => { if let Some ( ( i , _ ) ) = self . ints . iter ( ) . enumerate ( ) . find ( | ( _ , ( b , _ ) ) | b == & k ) { Some ( self . ints . remove ( i ) . 1 ) } else { None } } Key :: StrCap ( k ) => { if let Some ( ( i , _ ) ) = self . strs . iter ( ) . enumerate ( ) . find ( | ( _ , ( b , _ ) ) | b == & k ) { Some ( self . strs . remove ( i ) . 1 ) } else { None } } Key :: Name ( k ) => match self . ex . remove ( k ) { v @ Some ( BooleanValue ( _ ) ) => { if let Some ( ( i , _ ) ) = self . ex_bools . iter ( ) . enumerate ( ) . find ( | ( _ , ek ) | ek == & k ) { self . ex_bools . remove ( i ) ; } v } v @ Some ( IntegerValue ( _ ) ) => { if let Some ( ( i , _ ) ) = self . ex_nums . iter ( ) . enumerate ( ) . find ( | ( _ , ek ) | ek == & k ) { self . ex_nums . remove ( i ) ; } v } v @ Some ( StringValue ( _ ) ) => { if let Some ( ( i , _ ) ) = self . ex_strs . iter ( ) . enumerate ( ) . find ( | ( _ , ek ) | ek == & k ) { self . ex_strs . remove ( i ) ; } v } _ => None , } , } }
Remove a value from the terminfo struct.
Remove a value from the terminfo struct .
&mut self
k
K
&mut self
k
K