20
20
//! the field `next_edge`). Each of those fields is an array that should
21
21
//! be indexed by the direction (see the type `Direction`).
22
22
23
- use crate :: snapshot_vec:: { SnapshotVec , SnapshotVecDelegate } ;
24
23
use rustc_index:: bit_set:: BitSet ;
25
24
use std:: fmt:: Debug ;
26
25
27
26
#[ cfg( test) ]
28
27
mod tests;
29
28
30
29
pub struct Graph < N , E > {
31
- nodes : SnapshotVec < Node < N > > ,
32
- edges : SnapshotVec < Edge < E > > ,
30
+ nodes : Vec < Node < N > > ,
31
+ edges : Vec < Edge < E > > ,
33
32
}
34
33
35
34
pub struct Node < N > {
@@ -45,20 +44,6 @@ pub struct Edge<E> {
45
44
pub data : E ,
46
45
}
47
46
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
-
62
47
#[ derive( Copy , Clone , PartialEq , Debug ) ]
63
48
pub struct NodeIndex ( pub usize ) ;
64
49
@@ -86,11 +71,11 @@ impl NodeIndex {
86
71
87
72
impl < N : Debug , E : Debug > Graph < N , E > {
88
73
pub fn new ( ) -> Graph < N , E > {
89
- Graph { nodes : SnapshotVec :: new ( ) , edges : SnapshotVec :: new ( ) }
74
+ Graph { nodes : Vec :: new ( ) , edges : Vec :: new ( ) }
90
75
}
91
76
92
77
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) }
94
79
}
95
80
96
81
// # Simple accessors
0 commit comments