fn clean(&mut self) {
        // Multiple removes
        let mut removed: HashSet<ItemId> = HashSet::new();
        for ef in self.events.clone() {
            if let Some(id) = ef.removes_id() {
                if removed.contains(&id) {
                    self.events.remove_item(&ef);
                } else {
                    removed.insert(id);
                }
            }
        }
    }
/// Remove unnecessary events, such as multiple removes
Remove unnecessary events, such as multiple removes
Remove unnecessary events such as multiple removes
fn clean(&mut self) {
        // Multiple removes
        let mut removed: HashSet<ItemId> = HashSet::new();
        for ef in self.events.clone() {
            if let Some(id) = ef.removes_id() {
                if removed.contains(&id) {
                    self.events.remove_item(&ef);
                } else {
                    removed.insert(id);
                }
            }
        }
    }
fn clean ( & mut self ) { // Multiple removes let mut removed : HashSet < ItemId > = HashSet :: new ( ) ; for ef in self . events . clone ( ) { if let Some ( id ) = ef . removes_id ( ) { if removed . contains ( & id ) { self . events . remove_item ( & ef ) ; } else { removed . insert ( id ) ; } } } }
Remove unnecessary events, such as multiple removes
Remove unnecessary events such as multiple removes
&mut self
&mut self