Location (URL)
https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.split_off
Summary
The following code is working (as expected?):
use std::collections::BTreeMap;
fn main() {
let mut a = BTreeMap::new();
a.insert(1, "a");
a.insert(2, "b");
a.insert(3, "c");
a.insert(17, "d");
a.insert(41, "e");
let b = a.split_off(&4);
assert_eq!(a.len(), 3);
assert_eq!(b.len(), 2);
}
Notice the split_off call with the key that does not exists in the tree.
Location (URL)
https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.split_off
Summary
The following code is working (as expected?):
Notice the
split_offcall with the key that does not exists in the tree.