aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_arena/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-08 12:53:32 +0000
committerAleksey Kladov <[email protected]>2019-01-08 12:53:32 +0000
commitd4c8310d059e76f28c81e1e404dfe79b982bc23b (patch)
tree49ace1774d9ed6ebfa141af27368030fa4c3279d /crates/ra_arena/src
parent5603237c069c600963b8e25481af397b25e3b185 (diff)
switch interner to use arena
Diffstat (limited to 'crates/ra_arena/src')
-rw-r--r--crates/ra_arena/src/lib.rs3
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
63impl<ID: ArenaId, T> Arena<ID, T> { 63impl<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);