(&self, key: &K)
| 285 | } |
| 286 | |
| 287 | fn get_mut(&self, key: &K) -> Option<&mut V> { |
| 288 | unsafe { |
| 289 | let mut node = self.root; |
| 290 | while !node.is_null() { |
| 291 | node = match (*node).key.cmp(key) { |
| 292 | Less => (*node).right, |
| 293 | Equal => return Some(&mut (*node).val), |
| 294 | Greater => (*node).left, |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | None |
| 300 | } |
| 301 | |
| 302 | // 数据插入 |
| 303 | fn insert(&mut self, key: K, val: V) { |
no test coverage detected