@@ -1117,21 +1117,23 @@ impl<K: Ord, V> BTreeMap<K, V> {
1117
1117
right
1118
1118
}
1119
1119
1120
- /// Creates an iterator which uses a closure to determine if an element should be removed.
1121
- ///
1122
- /// If the closure returns true, the element is removed from the map and yielded.
1123
- /// If the closure returns false, or panics, the element remains in the map and will not be
1124
- /// yielded.
1125
- ///
1126
- /// Note that `drain_filter` lets you mutate every value in the filter closure, regardless of
1127
- /// whether you choose to keep or remove it.
1128
- ///
1129
- /// If the iterator is only partially consumed or not consumed at all, each of the remaining
1130
- /// elements will still be subjected to the closure and removed and dropped if it returns true.
1131
- ///
1132
- /// It is unspecified how many more elements will be subjected to the closure
1133
- /// if a panic occurs in the closure, or a panic occurs while dropping an element,
1134
- /// or if the `DrainFilter` value is leaked.
1120
+ /// Creates an iterator that visits all elements (key-value pairs) in
1121
+ /// ascending key order and uses a closure to determine if an element should
1122
+ /// be removed. If the closure returns `true`, the element is removed from
1123
+ /// the map and yielded. If the closure returns `false`, or panics, the
1124
+ /// element remains in the map and will not be yielded.
1125
+ ///
1126
+ /// The iterator also lets you mutate the value of each element in the
1127
+ /// closure, regardless of whether you choose to keep or remove it.
1128
+ ///
1129
+ /// If the iterator is only partially consumed or not consumed at all, each
1130
+ /// of the remaining elements is still subjected to the closure, which may
1131
+ /// change its value and, by returning `true`, have the element removed and
1132
+ /// dropped.
1133
+ ///
1134
+ /// It is unspecified how many more elements will be subjected to the
1135
+ /// closure if a panic occurs in the closure, or a panic occurs while
1136
+ /// dropping an element, or if the `DrainFilter` value is leaked.
1135
1137
///
1136
1138
/// # Examples
1137
1139
///
0 commit comments