diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-21 23:42:32 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-21 23:42:32 +0200 |
| commit | 7003d9de96824f3e1cb67d56c1c4be883f6e2520 (patch) | |
| tree | 896578ac2a3250e2bbbc405fbe8e1cf136ab0b90 /engine-ecs/src/util/array_vec.rs | |
| parent | dfa772c8c901500f679249c9a6e0bd25b05ca4d7 (diff) | |
refactor(engine-ecs): fix clippy lints
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); |
