@@ -121,8 +121,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
121
121
}
122
122
}
123
123
124
- ///////////////////////////////////////////////////////////////////////////
125
- // Simple accessors
124
+ // # Simple accessors
126
125
127
126
#[ inline]
128
127
pub fn all_nodes ( & self ) -> & [ Node < N > ] {
@@ -144,8 +143,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
144
143
self . edges . len ( )
145
144
}
146
145
147
- ///////////////////////////////////////////////////////////////////////////
148
- // Node construction
146
+ // # Node construction
149
147
150
148
pub fn next_node_index ( & self ) -> NodeIndex {
151
149
NodeIndex ( self . nodes . len ( ) )
@@ -172,8 +170,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
172
170
& self . nodes [ idx. 0 ]
173
171
}
174
172
175
- ///////////////////////////////////////////////////////////////////////////
176
- // Edge construction and queries
173
+ // # Edge construction and queries
177
174
178
175
pub fn next_edge_index ( & self ) -> EdgeIndex {
179
176
EdgeIndex ( self . edges . len ( ) )
@@ -232,8 +229,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
232
229
self . edges [ edge. 0 ] . next_edge [ dir. repr ]
233
230
}
234
231
235
- ///////////////////////////////////////////////////////////////////////////
236
- // Iterating over nodes, edges
232
+ // # Iterating over nodes, edges
237
233
238
234
pub fn each_node < ' a , F > ( & ' a self , mut f : F ) -> bool
239
235
where F : FnMut ( NodeIndex , & ' a Node < N > ) -> bool
@@ -274,8 +270,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
274
270
self . incoming_edges ( target) . sources ( )
275
271
}
276
272
277
- ///////////////////////////////////////////////////////////////////////////
278
- // Fixed-point iteration
273
+ // # Fixed-point iteration
279
274
//
280
275
// A common use for graphs in our compiler is to perform
281
276
// fixed-point iteration. In this case, each edge represents a
@@ -306,8 +301,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
306
301
}
307
302
}
308
303
309
- ///////////////////////////////////////////////////////////////////////////
310
- // Iterators
304
+ // # Iterators
311
305
312
306
pub struct AdjacentEdges < ' g , N , E >
313
307
where N : ' g ,
0 commit comments