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

Method drop

src/strings/tst.rs:233–244  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

231
232impl<T> Drop for TST<T> {
233 fn drop(&mut self) {
234 fn visitor<T>(p: Option<NonNull<Node<T>>>) {
235 if let Some(p) = p {
236 let subtries = unsafe { Box::from_raw(p.as_ptr()).subtries };
237 subtries.iter().for_each(|it| visitor(*it));
238 }
239 }
240
241 let root = self.root.take();
242 visitor(root);
243 self.n = 0;
244 }
245}
246
247impl<T> Node<T> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected