@@ -2603,6 +2603,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2603
2603
/// a.insert(2, "b");
2604
2604
/// a.insert(3, "c");
2605
2605
/// a.insert(4, "c");
2606
+ /// let cursor = a.lower_bound(Bound::Included(&2));
2607
+ /// assert_eq!(cursor.key(), Some(&2));
2606
2608
/// let cursor = a.lower_bound(Bound::Excluded(&2));
2607
2609
/// assert_eq!(cursor.key(), Some(&3));
2608
2610
/// ```
@@ -2644,6 +2646,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2644
2646
/// a.insert(2, "b");
2645
2647
/// a.insert(3, "c");
2646
2648
/// a.insert(4, "c");
2649
+ /// let cursor = a.lower_bound_mut(Bound::Included(&2));
2650
+ /// assert_eq!(cursor.key(), Some(&2));
2647
2651
/// let cursor = a.lower_bound_mut(Bound::Excluded(&2));
2648
2652
/// assert_eq!(cursor.key(), Some(&3));
2649
2653
/// ```
@@ -2698,6 +2702,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2698
2702
/// a.insert(2, "b");
2699
2703
/// a.insert(3, "c");
2700
2704
/// a.insert(4, "c");
2705
+ /// let cursor = a.upper_bound(Bound::Included(&3));
2706
+ /// assert_eq!(cursor.key(), Some(&3));
2701
2707
/// let cursor = a.upper_bound(Bound::Excluded(&3));
2702
2708
/// assert_eq!(cursor.key(), Some(&2));
2703
2709
/// ```
@@ -2739,6 +2745,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
2739
2745
/// a.insert(2, "b");
2740
2746
/// a.insert(3, "c");
2741
2747
/// a.insert(4, "c");
2748
+ /// let cursor = a.upper_bound_mut(Bound::Included(&3));
2749
+ /// assert_eq!(cursor.key(), Some(&3));
2742
2750
/// let cursor = a.upper_bound_mut(Bound::Excluded(&3));
2743
2751
/// assert_eq!(cursor.key(), Some(&2));
2744
2752
/// ```
0 commit comments