@@ -70,21 +70,21 @@ pub fn reverse_post_order<G: DirectedGraph + Successors>(
70
70
}
71
71
72
72
/// A "depth-first search" iterator for a directed graph.
73
- pub struct DepthFirstSearch < ' graph , G >
73
+ pub struct DepthFirstSearch < G >
74
74
where
75
- G : ? Sized + DirectedGraph + Successors ,
75
+ G : DirectedGraph + Successors ,
76
76
{
77
- graph : & ' graph G ,
77
+ graph : G ,
78
78
stack : Vec < G :: Node > ,
79
79
visited : BitSet < G :: Node > ,
80
80
}
81
81
82
- impl < ' graph , G > DepthFirstSearch < ' graph , G >
82
+ impl < G > DepthFirstSearch < G >
83
83
where
84
- G : ? Sized + DirectedGraph + Successors ,
84
+ G : DirectedGraph + Successors ,
85
85
{
86
- pub fn new ( graph : & ' graph G ) -> Self {
87
- Self { graph , stack : vec ! [ ] , visited : BitSet :: new_empty ( graph. num_nodes ( ) ) }
86
+ pub fn new ( graph : G ) -> Self {
87
+ Self { stack : vec ! [ ] , visited : BitSet :: new_empty ( graph. num_nodes ( ) ) , graph }
88
88
}
89
89
90
90
/// Version of `push_start_node` that is convenient for chained
@@ -125,9 +125,9 @@ where
125
125
}
126
126
}
127
127
128
- impl < G > std:: fmt:: Debug for DepthFirstSearch < ' _ , G >
128
+ impl < G > std:: fmt:: Debug for DepthFirstSearch < G >
129
129
where
130
- G : ? Sized + DirectedGraph + Successors ,
130
+ G : DirectedGraph + Successors ,
131
131
{
132
132
fn fmt ( & self , fmt : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
133
133
let mut f = fmt. debug_set ( ) ;
@@ -138,9 +138,9 @@ where
138
138
}
139
139
}
140
140
141
- impl < G > Iterator for DepthFirstSearch < ' _ , G >
141
+ impl < G > Iterator for DepthFirstSearch < G >
142
142
where
143
- G : ? Sized + DirectedGraph + Successors ,
143
+ G : DirectedGraph + Successors ,
144
144
{
145
145
type Item = G :: Node ;
146
146
0 commit comments