MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / into_iter

Method into_iter

publication/code/chapter04/linked_list.rs:72–74  ·  view source on GitHub ↗

以下是为链表实现的迭代功能 into_iter: 链表改变,成为迭代器 iter: 链表不变,只得到不可变迭代器 iter_mut: 链表不变,得到可变迭代器

(self)

Source from the content-addressed store, hash-verified

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() }

Callers 1

into_iter_testFunction · 0.45

Calls 1

IntoIterClass · 0.70

Tested by

no test coverage detected