@@ -19,16 +19,16 @@ mod entry;
19
19
pub use entry:: { Entry , OccupiedEntry , OccupiedError , VacantEntry } ;
20
20
use Entry :: * ;
21
21
22
- /// Minimum number of elements in nodes that are not a root.
22
+ /// Minimum number of elements in a node that is not a root.
23
23
/// We might temporarily have fewer elements during methods.
24
24
pub ( super ) const MIN_LEN : usize = node:: MIN_LEN_AFTER_SPLIT ;
25
25
26
26
// A tree in a `BTreeMap` is a tree in the `node` module with additional invariants:
27
27
// - Keys must appear in ascending order (according to the key's type).
28
- // - If the root node is internal, it must contain at least 1 element .
28
+ // - Every non-leaf node contains at least 1 element (has at least 2 children) .
29
29
// - Every non-root node contains at least MIN_LEN elements.
30
30
//
31
- // An empty map may be represented both by the absence of a root node or by a
31
+ // An empty map is represented either by the absence of a root node or by a
32
32
// root node that is an empty leaf.
33
33
34
34
/// A map based on a [B-Tree].
@@ -1735,8 +1735,8 @@ impl<'a, K: 'a, V: 'a> DrainFilterInner<'a, K, V> {
1735
1735
pub ( super ) fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1736
1736
// In most of the btree iterators, `self.length` is the number of elements
1737
1737
// yet to be visited. Here, it includes elements that were visited and that
1738
- // the predicate decided not to drain. Making this upper bound more accurate
1739
- // requires maintaining an extra field and is not worth while .
1738
+ // the predicate decided not to drain. Making this upper bound more tight
1739
+ // during iteration would require an extra field.
1740
1740
( 0 , Some ( * self . length ) )
1741
1741
}
1742
1742
}
0 commit comments