@@ -17,16 +17,16 @@ mod entry;
1717pub use entry:: { Entry , OccupiedEntry , OccupiedError , VacantEntry } ;
1818use Entry :: * ;
1919
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.
2121/// We might temporarily have fewer elements during methods.
2222pub ( super ) const MIN_LEN : usize = node:: MIN_LEN_AFTER_SPLIT ;
2323
2424// A tree in a `BTreeMap` is a tree in the `node` module with additional invariants:
2525// - 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) .
2727// - Every non-root node contains at least MIN_LEN elements.
2828//
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
3030// root node that is an empty leaf.
3131
3232/// A map based on a [B-Tree].
@@ -1723,8 +1723,8 @@ impl<'a, K: 'a, V: 'a> DrainFilterInner<'a, K, V> {
17231723 pub ( super ) fn size_hint ( & self ) -> ( usize , Option < usize > ) {
17241724 // In most of the btree iterators, `self.length` is the number of elements
17251725 // 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.
17281728 ( 0 , Some ( * self . length ) )
17291729 }
17301730}
0 commit comments