pub fn move_focused_to_group<'a, S>(&'a mut self, name: S)
    where
        S: Into<&'a str>,
    {
        let name = name.into();

        // If the group is currently active, then do nothing. This avoids flicker as we
        // unmap/remap.
        if name == self.group().name() {
            return;
        }

        if let Some(removed) = self.group_mut().remove_focused() {
            let new_group = self.groups.iter_mut().find(|group| group.name() == name);
            match new_group {
                Some(new_group) => {
                    new_group.add_window(removed);
                }
                None => {
                    // It would be nice to put the window back in its group (or avoid taking it out
                    // of its group until we've checked the new group exists), but it's difficult
                    // to do this while keeping the borrow checker happy.
                    error!("Moved window to non-existent group: {}", name);
                }
            }
        }
    }
/// Move the focused window from the active group to another named group.
///
/// If the other named group does not exist, then the window is
/// (unfortunately) lost.
Move the focused window from the active group to another named group.
If the other named group does not exist, then the window is
(unfortunately) lost.
Move the focused window from the active group to another named group . If the other named group does not exist then the window is ( unfortunately ) lost .
pub fn move_focused_to_group<'a, S>(&'a mut self, name: S)
    where
        S: Into<&'a str>,
    {
        let name = name.into();
        // If the group is currently active, then do nothing. This avoids flicker as we
        // unmap/remap.
        if name == self.group().name() {
            return;
        }
        if let Some(removed) = self.group_mut().remove_focused() {
            let new_group = self.groups.iter_mut().find(|group| group.name() == name);
            match new_group {
                Some(new_group) => {
                    new_group.add_window(removed);
                }
                None => {
                    // It would be nice to put the window back in its group (or avoid taking it out
                    // of its group until we've checked the new group exists), but it's difficult
                    // to do this while keeping the borrow checker happy.
                    error!("Moved window to non-existent group: {}", name);
                }
            }
        }
    }
pub fn move_focused_to_group < ' a , S > ( & ' a mut self , name : S ) where S : Into < & ' a str > , { let name = name . into ( ) ; // If the group is currently active, then do nothing. This avoids flicker as we // unmap/remap. if name == self . group ( ) . name ( ) { return ; } if let Some ( removed ) = self . group_mut ( ) . remove_focused ( ) { let new_group = self . groups . iter_mut ( ) . find ( | group | group . name ( ) == name ) ; match new_group { Some ( new_group ) => { new_group . add_window ( removed ) ; } None => { // It would be nice to put the window back in its group (or avoid taking it out // of its group until we've checked the new group exists), but it's difficult // to do this while keeping the borrow checker happy. error ! ( " " name ) ; } } } }
Move the focused window from the active group to another named group.
Move the focused window from the active group to another named group .
&'a mut self
name
S