-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-collectionsArea: `std::collections`Area: `std::collections`A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
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.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.