fn remove_node(&mut self, node: Self::TIndex) -> Option<TNode> {
        if let Some(n) = self.nodes.remove(&node) {
            for edge_idx in n.succ {
                if let Some(e) = self.edges.remove(&edge_idx) {
                    self.nodes.get_mut(&e.end).unwrap().remove_pred(edge_idx);
                }
            }
            for edge_idx in n.pred {
                if let Some(e) = self.edges.remove(&edge_idx) {
                    self.nodes.get_mut(&e.start).unwrap().remove_succ(edge_idx);
                }
            }
            Some(n.data)
        } else {
            None
        }
    }
// Removes node and all incident edges
Removes node and all incident edges
Removes node and all incident edges
fn remove_node(&mut self, node: Self::TIndex) -> Option<TNode> {
        if let Some(n) = self.nodes.remove(&node) {
            for edge_idx in n.succ {
                if let Some(e) = self.edges.remove(&edge_idx) {
                    self.nodes.get_mut(&e.end).unwrap().remove_pred(edge_idx);
                }
            }
            for edge_idx in n.pred {
                if let Some(e) = self.edges.remove(&edge_idx) {
                    self.nodes.get_mut(&e.start).unwrap().remove_succ(edge_idx);
                }
            }
            Some(n.data)
        } else {
            None
        }
    }
fn remove_node ( & mut self , node : Self :: TIndex ) -> Option < TNode > { if let Some ( n ) = self . nodes . remove ( & node ) { for edge_idx in n . succ { if let Some ( e ) = self . edges . remove ( & edge_idx ) { self . nodes . get_mut ( & e . end ) . unwrap ( ) . remove_pred ( edge_idx ) ; } } for edge_idx in n . pred { if let Some ( e ) = self . edges . remove ( & edge_idx ) { self . nodes . get_mut ( & e . start ) . unwrap ( ) . remove_succ ( edge_idx ) ; } } Some ( n . data ) } else { None } }
Removes node and all incident edges
Removes node and all incident edges
&mut self
node
Self::TIndex
&mut self
node
Self::TIndex