pub fn swap_tabs(&mut self, fst: &str, snd: &str) {
        let mut fst_pos: Option<usize> = None;
        let mut snd_pos: Option<usize> = None;
        for (pos, key) in self.tab_order().into_iter().enumerate() {
            match key {
                val if val == *fst => fst_pos = Some(pos),
                val if val == *snd => snd_pos = Some(pos),
                _ => {}
            }
        }
        if let (Some(fst_pos), Some(snd_pos)) = (fst_pos, snd_pos) {
            if let Some(cur) = self.current_id.as_ref() {
                if self.active_key_tx.is_some() && (fst == cur || snd == cur) {
                    self.active_key_tx.as_mut().unwrap().send(cur.to_owned()).expect("Sending failed.");
                }
            }
            self.key_order.swap(fst_pos, snd_pos);
        }
    }
/// Swap the tabs position.
/// If one of the given key cannot be found, then no operation is performed.
Swap the tabs position.
If one of the given key cannot be found, then no operation is performed.
Swap the tabs position . If one of the given key cannot be found then no operation is performed .
pub fn swap_tabs(&mut self, fst: &str, snd: &str) {
        let mut fst_pos: Option<usize> = None;
        let mut snd_pos: Option<usize> = None;
        for (pos, key) in self.tab_order().into_iter().enumerate() {
            match key {
                val if val == *fst => fst_pos = Some(pos),
                val if val == *snd => snd_pos = Some(pos),
                _ => {}
            }
        }
        if let (Some(fst_pos), Some(snd_pos)) = (fst_pos, snd_pos) {
            if let Some(cur) = self.current_id.as_ref() {
                if self.active_key_tx.is_some() && (fst == cur || snd == cur) {
                    self.active_key_tx.as_mut().unwrap().send(cur.to_owned()).expect("Sending failed.");
                }
            }
            self.key_order.swap(fst_pos, snd_pos);
        }
    }
pub fn swap_tabs ( & mut self , fst : & str , snd : & str ) { let mut fst_pos : Option < usize > = None ; let mut snd_pos : Option < usize > = None ; for ( pos , key ) in self . tab_order ( ) . into_iter ( ) . enumerate ( ) { match key { val if val == * fst => fst_pos = Some ( pos ) , val if val == * snd => snd_pos = Some ( pos ) , _ => { } } } if let ( Some ( fst_pos ) , Some ( snd_pos ) ) = ( fst_pos , snd_pos ) { if let Some ( cur ) = self . current_id . as_ref ( ) { if self . active_key_tx . is_some ( ) && ( fst == cur || snd == cur ) { self . active_key_tx . as_mut ( ) . unwrap ( ) . send ( cur . to_owned ( ) ) . expect ( " " ) ; } } self . key_order . swap ( fst_pos , snd_pos ) ; } }
Swap the tabs position.
Swap the tabs position .
&mut self
fst
&str
snd
&str