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

Method into_iter

publication/code/chapter04/stack.rs:60–62  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

58 // iter: 栈不变,得到不可变迭代器
59 // iter_mut: 栈不变,得到可变迭代器
60 fn into_iter(self) -> IntoIter<T> {
61 IntoIter(self)
62 }
63
64 fn iter(&self) -> Iter<T> {
65 let mut iterator = Iter { stack: Vec::new() };

Callers

nothing calls this directly

Calls 1

IntoIterClass · 0.70

Tested by

no test coverage detected