aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-04-26 16:42:10 +0100
committerkjeremy <[email protected]>2019-04-26 16:42:10 +0100
commit4251f083b551de9bfe15d11bb4b485c0a5de86ab (patch)
treee98f7abe47f3fb4b1590d17585cda76f2bc78b97 /crates
parent47f10fce8ada7638e3298e3e12f794b4859af754 (diff)
Add is_empty to Arena
Diffstat (limited to 'crates')
-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 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);