Skip to content

Commit 4f5267d

Browse files
committed
add a few accessors to Graph
1 parent 004d702 commit 4f5267d

File tree

1 file changed

+10
-0
lines changed
  • src/librustc_data_structures/graph

1 file changed

+10
-0
lines changed

src/librustc_data_structures/graph/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,21 @@ impl<N:Debug,E:Debug> Graph<N,E> {
119119
&self.nodes
120120
}
121121

122+
#[inline]
123+
pub fn len_nodes(&self) -> usize {
124+
self.nodes.len()
125+
}
126+
122127
#[inline]
123128
pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] {
124129
&self.edges
125130
}
126131

132+
#[inline]
133+
pub fn len_edges(&self) -> usize {
134+
self.edges.len()
135+
}
136+
127137
///////////////////////////////////////////////////////////////////////////
128138
// Node construction
129139

0 commit comments

Comments
 (0)