(&self)
| 284 | // === rustpython additions === |
| 285 | |
| 286 | pub fn iter(&self) -> impl Iterator<Item = &L::Target> { |
| 287 | core::iter::successors(self.head, |node| unsafe { |
| 288 | L::pointers(*node).as_ref().get_next() |
| 289 | }) |
| 290 | .map(|ptr| unsafe { ptr.as_ref() }) |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | impl<L: Link> fmt::Debug for LinkedList<L, L::Target> { |