Remove the key-value pair at `index` from this leaf node. Return an indication of the node's health (i.e. below half capacity).
(&mut self, index: usize)
| 332 | /// |
| 333 | /// Return an indication of the node's health (i.e. below half capacity). |
| 334 | pub fn leaf_remove(&mut self, index: usize) -> Removed { |
| 335 | match *self { |
| 336 | Self::Leaf { |
| 337 | ref mut size, |
| 338 | ref mut keys, |
| 339 | ref mut vals, |
| 340 | } => { |
| 341 | let sz = usize::from(*size); |
| 342 | let keys = keys.borrow_mut(); |
| 343 | let vals = vals.borrow_mut(); |
| 344 | *size -= 1; |
| 345 | slice_shift(&mut keys[index..sz], 1); |
| 346 | slice_shift(&mut vals[index..sz], 1); |
| 347 | Removed::new(index, sz - 1, keys.len()) |
| 348 | } |
| 349 | _ => panic!("Expected leaf node"), |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | /// Balance this node with its right sibling. |
| 354 | /// |
no test coverage detected