diff options
Diffstat (limited to 'crates/ra_arena/src/lib.rs')
-rw-r--r-- | crates/ra_arena/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_arena/src/lib.rs b/crates/ra_arena/src/lib.rs index 040977dc4..43bfa925a 100644 --- a/crates/ra_arena/src/lib.rs +++ b/crates/ra_arena/src/lib.rs | |||
@@ -61,6 +61,9 @@ pub trait ArenaId { | |||
61 | } | 61 | } |
62 | 62 | ||
63 | impl<ID: ArenaId, T> Arena<ID, T> { | 63 | impl<ID: ArenaId, T> Arena<ID, T> { |
64 | pub fn len(&self) -> usize { | ||
65 | self.data.len() | ||
66 | } | ||
64 | pub fn alloc(&mut self, value: T) -> ID { | 67 | pub fn alloc(&mut self, value: T) -> ID { |
65 | let id = RawId(self.data.len() as u32); | 68 | let id = RawId(self.data.len() as u32); |
66 | self.data.push(value); | 69 | self.data.push(value); |