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