pub fn remove_group(&mut self, group: &str) -> Result<()> {
        self.settings.daemon.groups.remove(group);
        self.groups.remove(group);

        // Reset all tasks with removed group to the default
        for (_, task) in self.tasks.iter_mut() {
            if let Some(group_name) = &task.group {
                if group_name == group {
                    task.group = None;
                }
            }
        }

        self.save();
        self.settings.save()
    }
/// Remove a group.
/// Also go through all tasks and set the removed group to `None`.
Remove a group.
Also go through all tasks and set the removed group to `None`.
Remove a group . Also go through all tasks and set the removed group to ` None ` .
pub fn remove_group(&mut self, group: &str) -> Result<()> {
        self.settings.daemon.groups.remove(group);
        self.groups.remove(group);
        // Reset all tasks with removed group to the default
        for (_, task) in self.tasks.iter_mut() {
            if let Some(group_name) = &task.group {
                if group_name == group {
                    task.group = None;
                }
            }
        }
        self.save();
        self.settings.save()
    }
pub fn remove_group ( & mut self , group : & str ) -> Result < ( ) > { self . settings . daemon . groups . remove ( group ) ; self . groups . remove ( group ) ; // Reset all tasks with removed group to the default for ( _ , task ) in self . tasks . iter_mut ( ) { if let Some ( group_name ) = & task . group { if group_name == group { task . group = None ; } } } self . save ( ) ; self . settings . save ( ) }
Remove a group.
Remove a group .
&mut self
group
&str