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

Method iter_mut

publication/code/chapter08/rbtree.rs:511–521  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

509 }
510
511 fn iter_mut<'a>(&mut self) -> IterMut<'a, K, V> {
512 let mut iterator = IterMut { stack: Vec::new() };
513 let mut node = self.root;
514 unsafe {
515 while !node.is_null() {
516 iterator.stack.push(&mut *node);
517 node = (*node).left;
518 }
519 }
520 iterator
521 }
522}
523
524// 实现迭代功能

Callers 1

iterFunction · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected