| 157 | |
| 158 | #[inline] |
| 159 | fn nth_back(&mut self, n: usize) -> Option<Self::Item> { |
| 160 | // Check if we advance to the one before the desired offset |
| 161 | match self.current_end.checked_sub(n) { |
| 162 | // Yes, and still within bounds |
| 163 | Some(new_offset) if self.current < new_offset => { |
| 164 | self.current_end = new_offset; |
| 165 | } |
| 166 | |
| 167 | // Either underflow or would exceed current |
| 168 | _ => { |
| 169 | self.current = self.current_end; |
| 170 | return None; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | self.next_back() |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | /// all arrays have known size. |