A few cleanups for rustc_data_structures

This commit is contained in:
ljedrz
2018-08-09 17:00:14 +02:00
parent 160187937d
commit 94c3856804
10 changed files with 27 additions and 24 deletions

View File

@@ -90,7 +90,7 @@ pub const INCOMING: Direction = Direction { repr: 1 };
impl NodeIndex {
/// Returns unique id (unique with respect to the graph holding associated node).
pub fn node_id(&self) -> usize {
pub fn node_id(self) -> usize {
self.0
}
}
@@ -187,7 +187,7 @@ impl<N: Debug, E: Debug> Graph<N, E> {
self.nodes[source.0].first_edge[OUTGOING.repr] = idx;
self.nodes[target.0].first_edge[INCOMING.repr] = idx;
return idx;
idx
}
pub fn edge(&self, idx: EdgeIndex) -> &Edge<E> {
@@ -261,8 +261,8 @@ impl<N: Debug, E: Debug> Graph<N, E> {
DepthFirstTraversal::with_start_node(self, start, direction)
}
pub fn nodes_in_postorder<'a>(
&'a self,
pub fn nodes_in_postorder(
&self,
direction: Direction,
entry_node: NodeIndex,
) -> Vec<NodeIndex> {