2020//! the field `next_edge`). Each of those fields is an array that should
2121//! be indexed by the direction (see the type `Direction`).
2222
23- use crate :: snapshot_vec:: { SnapshotVec , SnapshotVecDelegate } ;
2423use rustc_index:: bit_set:: BitSet ;
2524use std:: fmt:: Debug ;
2625
2726#[ cfg( test) ]
2827mod tests;
2928
3029pub struct Graph < N , E > {
31- nodes : SnapshotVec < Node < N > > ,
32- edges : SnapshotVec < Edge < E > > ,
30+ nodes : Vec < Node < N > > ,
31+ edges : Vec < Edge < E > > ,
3332}
3433
3534pub struct Node < N > {
@@ -45,20 +44,6 @@ pub struct Edge<E> {
4544 pub data : E ,
4645}
4746
48- impl < N > SnapshotVecDelegate for Node < N > {
49- type Value = Node < N > ;
50- type Undo = ( ) ;
51-
52- fn reverse ( _: & mut Vec < Node < N > > , _: ( ) ) { }
53- }
54-
55- impl < N > SnapshotVecDelegate for Edge < N > {
56- type Value = Edge < N > ;
57- type Undo = ( ) ;
58-
59- fn reverse ( _: & mut Vec < Edge < N > > , _: ( ) ) { }
60- }
61-
6247#[ derive( Copy , Clone , PartialEq , Debug ) ]
6348pub struct NodeIndex ( pub usize ) ;
6449
@@ -86,11 +71,11 @@ impl NodeIndex {
8671
8772impl < N : Debug , E : Debug > Graph < N , E > {
8873 pub fn new ( ) -> Graph < N , E > {
89- Graph { nodes : SnapshotVec :: new ( ) , edges : SnapshotVec :: new ( ) }
74+ Graph { nodes : Vec :: new ( ) , edges : Vec :: new ( ) }
9075 }
9176
9277 pub fn with_capacity ( nodes : usize , edges : usize ) -> Graph < N , E > {
93- Graph { nodes : SnapshotVec :: with_capacity ( nodes) , edges : SnapshotVec :: with_capacity ( edges) }
78+ Graph { nodes : Vec :: with_capacity ( nodes) , edges : Vec :: with_capacity ( edges) }
9479 }
9580
9681 // # Simple accessors
0 commit comments