(&mut self)
| 19 | pub(crate) fn has_pixels(&self) -> bool { |
| 20 | !self.rgba.is_empty() |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | #[derive(Default)] |
| 25 | struct SlotArena { |
| 26 | generations: Vec<u32>, |
| 27 | occupied: Vec<bool>, |
| 28 | free_slots: Vec<usize>, |
| 29 | } |
| 30 | |
| 31 | impl SlotArena { |
| 32 | #[inline] |
| 33 | fn create_parts(&mut self) -> (u32, u32) { |
| 34 | if let Some(slot) = self.free_slots.pop() { |
| 35 | self.generations[slot] = self.generations[slot].wrapping_add(1); |
no test coverage detected