@@ -70,21 +70,21 @@ pub fn reverse_post_order<G: DirectedGraph + Successors>(
7070}
7171
7272/// A "depth-first search" iterator for a directed graph.
73- pub struct DepthFirstSearch < ' graph , G >
73+ pub struct DepthFirstSearch < G >
7474where
75- G : ? Sized + DirectedGraph + Successors ,
75+ G : DirectedGraph + Successors ,
7676{
77- graph : & ' graph G ,
77+ graph : G ,
7878 stack : Vec < G :: Node > ,
7979 visited : BitSet < G :: Node > ,
8080}
8181
82- impl < ' graph , G > DepthFirstSearch < ' graph , G >
82+ impl < G > DepthFirstSearch < G >
8383where
84- G : ? Sized + DirectedGraph + Successors ,
84+ G : DirectedGraph + Successors ,
8585{
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 }
8888 }
8989
9090 /// Version of `push_start_node` that is convenient for chained
@@ -125,9 +125,9 @@ where
125125 }
126126}
127127
128- impl < G > std:: fmt:: Debug for DepthFirstSearch < ' _ , G >
128+ impl < G > std:: fmt:: Debug for DepthFirstSearch < G >
129129where
130- G : ? Sized + DirectedGraph + Successors ,
130+ G : DirectedGraph + Successors ,
131131{
132132 fn fmt ( & self , fmt : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
133133 let mut f = fmt. debug_set ( ) ;
@@ -138,9 +138,9 @@ where
138138 }
139139}
140140
141- impl < G > Iterator for DepthFirstSearch < ' _ , G >
141+ impl < G > Iterator for DepthFirstSearch < G >
142142where
143- G : ? Sized + DirectedGraph + Successors ,
143+ G : DirectedGraph + Successors ,
144144{
145145 type Item = G :: Node ;
146146
0 commit comments