diff options
Diffstat (limited to 'engine-ecs/src/util/array_vec.rs')
| -rw-r--r-- | engine-ecs/src/util/array_vec.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/engine-ecs/src/util/array_vec.rs b/engine-ecs/src/util/array_vec.rs index 3e3344c..bfcc158 100644 --- a/engine-ecs/src/util/array_vec.rs +++ b/engine-ecs/src/util/array_vec.rs @@ -24,6 +24,8 @@ impl<Item, const CAPACITY: usize> ArrayVec<Item, CAPACITY> self.len == 0 } + /// # Panics + /// This function will panic if no more space is available. pub fn push(&mut self, item: Item) { assert!(self.len < CAPACITY); @@ -33,6 +35,9 @@ impl<Item, const CAPACITY: usize> ArrayVec<Item, CAPACITY> self.len += 1; } + /// # Panics + /// This function will panic if the index is out of bounds or if no more space is + /// available. pub fn insert(&mut self, index: usize, item: Item) { assert!(index <= self.len); |
