diff options
author | kjeremy <[email protected]> | 2019-04-26 16:42:10 +0100 |
---|---|---|
committer | kjeremy <[email protected]> | 2019-04-26 16:42:10 +0100 |
commit | 4251f083b551de9bfe15d11bb4b485c0a5de86ab (patch) | |
tree | e98f7abe47f3fb4b1590d17585cda76f2bc78b97 /crates/ra_arena/src | |
parent | 47f10fce8ada7638e3298e3e12f794b4859af754 (diff) |
Add is_empty to Arena
Diffstat (limited to 'crates/ra_arena/src')
-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 69b5f10e0..26641e690 100644 --- a/crates/ra_arena/src/lib.rs +++ b/crates/ra_arena/src/lib.rs | |||
@@ -71,6 +71,9 @@ impl<ID: ArenaId, T> Arena<ID, T> { | |||
71 | pub fn len(&self) -> usize { | 71 | pub fn len(&self) -> usize { |
72 | self.data.len() | 72 | self.data.len() |
73 | } | 73 | } |
74 | pub fn is_empty(&self) -> bool { | ||
75 | self.data.is_empty() | ||
76 | } | ||
74 | pub fn alloc(&mut self, value: T) -> ID { | 77 | pub fn alloc(&mut self, value: T) -> ID { |
75 | let id = RawId(self.data.len() as u32); | 78 | let id = RawId(self.data.len() as u32); |
76 | self.data.push(value); | 79 | self.data.push(value); |