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

Method next

publication/code/chapter04/queue.rs:84–90  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

82impl<T: Clone> Iterator for IntoIter<T> {
83 type Item = T;
84 fn next(&mut self) -> Option<Self::Item> {
85 if !self.0.is_empty() {
86 Some(self.0.data.remove(0))
87 } else {
88 None
89 }
90 }
91}
92
93struct Iter<'a, T: 'a> { stack: Vec<&'a T>, }

Callers

nothing calls this directly

Calls 3

is_emptyMethod · 0.45
removeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected