MCPcopy Index your code
hub / github.com/douchuan/algorithm / insert

Method insert

src/tree/binary/bst.rs:28–34  ·  view source on GitHub ↗
(&mut self, key: K, val: V)

Source from the content-addressed store, hash-verified

26 K: Ord,
27{
28 fn insert(&mut self, key: K, val: V) {
29 if let Ok(x) = unsafe { insert(self.root, key, val) } {
30 if self.root.is_none() {
31 self.root = Some(x);
32 }
33 }
34 }
35
36 fn delete(&mut self, key: &K) {
37 let node = unsafe { find(self.root, key) };

Callers

nothing calls this directly

Calls 2

is_noneMethod · 0.80
insertFunction · 0.70

Tested by

no test coverage detected