@@ -2543,6 +2543,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2543
2543
/// a.insert(2, "b");
2544
2544
/// a.insert(3, "c");
2545
2545
/// a.insert(4, "c");
2546
+ /// let cursor = a.lower_bound(Bound::Included(&2));
2547
+ /// assert_eq!(cursor.key(), Some(&2));
2546
2548
/// let cursor = a.lower_bound(Bound::Excluded(&2));
2547
2549
/// assert_eq!(cursor.key(), Some(&3));
2548
2550
/// ```
@@ -2582,6 +2584,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2582
2584
/// a.insert(2, "b");
2583
2585
/// a.insert(3, "c");
2584
2586
/// a.insert(4, "c");
2587
+ /// let cursor = a.lower_bound_mut(Bound::Included(&2));
2588
+ /// assert_eq!(cursor.key(), Some(&2));
2585
2589
/// let cursor = a.lower_bound_mut(Bound::Excluded(&2));
2586
2590
/// assert_eq!(cursor.key(), Some(&3));
2587
2591
/// ```
@@ -2634,6 +2638,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2634
2638
/// a.insert(2, "b");
2635
2639
/// a.insert(3, "c");
2636
2640
/// a.insert(4, "c");
2641
+ /// let cursor = a.upper_bound(Bound::Included(&3));
2642
+ /// assert_eq!(cursor.key(), Some(&3));
2637
2643
/// let cursor = a.upper_bound(Bound::Excluded(&3));
2638
2644
/// assert_eq!(cursor.key(), Some(&2));
2639
2645
/// ```
@@ -2673,6 +2679,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2673
2679
/// a.insert(2, "b");
2674
2680
/// a.insert(3, "c");
2675
2681
/// a.insert(4, "c");
2682
+ /// let cursor = a.upper_bound_mut(Bound::Included(&3));
2683
+ /// assert_eq!(cursor.key(), Some(&3));
2676
2684
/// let cursor = a.upper_bound_mut(Bound::Excluded(&3));
2677
2685
/// assert_eq!(cursor.key(), Some(&2));
2678
2686
/// ```
0 commit comments