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

Method into_iter

code/chapter03/linked_list.rs:67–69  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

65 // iter: 链表不变,只得到不可变迭代器
66 // iter_mut: 链表不变,得到可变迭代器
67 pub fn into_iter(self) -> IntoIter<T> {
68 IntoIter(self)
69 }
70
71 pub fn iter(&self) -> Iter<T> {
72 Iter { next: self.head.as_deref() }

Callers 2

bucket_sortFunction · 0.45
into_iter_testFunction · 0.45

Calls 1

IntoIterClass · 0.70

Tested by

no test coverage detected