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

Method into_iter

publication/code/chapter04/list_stack.rs:80–82  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

78 // iter: 链表栈不变,只得到不可变迭代器
79 // iter_mut: 链表栈不变,得到可变迭代器
80 fn into_iter(self) -> IntoIter<T> {
81 IntoIter(self)
82 }
83
84 fn iter(&self) -> Iter<T> {
85 Iter { next: self.top.as_deref() }

Callers

nothing calls this directly

Calls 1

IntoIterClass · 0.70

Tested by

no test coverage detected