MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / borrow_last

Method borrow_last

rust/src/node.rs:462–467  ·  view source on GitHub ↗

Borrow the last key-value pair from this leaf (used when this is the left sibling)

(&mut self)

Source from the content-addressed store, hash-verified

460
461 /// Borrow the last key-value pair from this leaf (used when this is the left sibling)
462 pub fn borrow_last(&mut self) -> Option<(K, V)> {
463 if self.keys.is_empty() || !self.can_donate() {
464 return None;
465 }
466 Some((self.keys.pop().unwrap(), self.values.pop().unwrap()))
467 }
468
469 /// Borrow the first key-value pair from this leaf (used when this is the right sibling)
470 pub fn borrow_first(&mut self) -> Option<(K, V)> {

Calls 3

is_emptyMethod · 0.45
can_donateMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected