diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-08-18 17:56:25 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-09-06 07:27:22 -0400 |
| commit | 4f5267dba31fdc49e436c50009fe33a80f21d477 (patch) | |
| tree | a09d6a5ab2a2747492b73296edf0b2fd1bb56904 /src/librustc_data_structures/graph | |
| parent | 004d70212ab40b35bcbe87df272b91fde10513b2 (diff) | |
| download | rust-4f5267dba31fdc49e436c50009fe33a80f21d477.tar.gz rust-4f5267dba31fdc49e436c50009fe33a80f21d477.zip | |
add a few accessors to Graph
Diffstat (limited to 'src/librustc_data_structures/graph')
| -rw-r--r-- | src/librustc_data_structures/graph/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc_data_structures/graph/mod.rs b/src/librustc_data_structures/graph/mod.rs index d73043c0430..4a3810c822b 100644 --- a/src/librustc_data_structures/graph/mod.rs +++ b/src/librustc_data_structures/graph/mod.rs @@ -120,10 +120,20 @@ impl<N:Debug,E:Debug> Graph<N,E> { } #[inline] + pub fn len_nodes(&self) -> usize { + self.nodes.len() + } + + #[inline] pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] { &self.edges } + #[inline] + pub fn len_edges(&self) -> usize { + self.edges.len() + } + /////////////////////////////////////////////////////////////////////////// // Node construction |
