以下是为链表实现的迭代功能 into_iter: 链表改变,成为迭代器 iter: 链表不变,只得到不可变迭代器 iter_mut: 链表不变,得到可变迭代器
(self)
| 70 | // iter: 链表不变,只得到不可变迭代器 |
| 71 | // iter_mut: 链表不变,得到可变迭代器 |
| 72 | fn into_iter(self) -> IntoIter<T> { |
| 73 | IntoIter(self) |
| 74 | } |
| 75 | |
| 76 | fn iter(&self) -> Iter<T> { |
| 77 | Iter { next: self.head.as_deref() } |
no test coverage detected