MCPcopy Create free account
hub / github.com/douchuan/algorithm / visitor

Method visitor

src/tree/binary/tree.rs:38–44  ·  view source on GitHub ↗
(p: Option<NonNull<Node<K, V>>>)

Source from the content-addressed store, hash-verified

36impl<K, V> Drop for Tree<K, V> {
37 fn drop(&mut self) {
38 fn visitor<K, V>(p: Option<NonNull<Node<K, V>>>) {
39 if let Some(p) = p {
40 let p = unsafe { Box::from_raw(p.as_ptr()) };
41 visitor(p.left);
42 visitor(p.right);
43 }
44 }
45 visitor(self.root);
46 }
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected