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

Method drop

src/strings/tries.rs:297–308  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

295
296impl<T> Drop for TrieST<T> {
297 fn drop(&mut self) {
298 fn visitor<T>(p: Option<NonNull<Node<T>>>) {
299 if let Some(p) = p {
300 let next = unsafe { Box::from_raw(p.as_ptr()).next };
301 next.iter().for_each(|it| visitor(*it));
302 }
303 }
304
305 let root = self.root.take();
306 visitor(root);
307 self.n = 0;
308 }
309}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected