| 79 | |
| 80 | #[inline] |
| 81 | fn next(&mut self) -> Option<Self::Item> { |
| 82 | if self.current == self.current_end { |
| 83 | None |
| 84 | } else if self.is_null(self.current) { |
| 85 | self.current += 1; |
| 86 | Some(None) |
| 87 | } else { |
| 88 | let old = self.current; |
| 89 | self.current += 1; |
| 90 | // Safety: |
| 91 | // we just checked bounds in `self.current_end == self.current` |
| 92 | // this is safe on the premise that this struct is initialized with |
| 93 | // current = array.len() |
| 94 | // and that current_end is ever only decremented |
| 95 | unsafe { Some(Some(self.array.value_unchecked(old))) } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | fn size_hint(&self) -> (usize, Option<usize>) { |
| 100 | ( |