File tree 3 files changed +10
-4
lines changed
library/alloc/src/collections
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
31
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
- /// A map based on a [B-Tree].
34
+ /// An ordered map based on a [B-Tree].
35
35
///
36
36
/// B-Trees represent a fundamental compromise between cache-efficiency and actually minimizing
37
37
/// the amount of work performed in a search. In theory, a binary search tree (BST) is the optimal
@@ -65,6 +65,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
65
65
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
66
66
/// behavior.
67
67
///
68
+ /// Entries in a `BTreeMap` are stored in ascending order according to the [`Ord`] implementation on the key.
69
+ /// Thus, iteration methods are guaranteed to produce iterators that yield items in that order.
70
+ ///
68
71
/// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
69
72
/// [`Cell`]: core::cell::Cell
70
73
/// [`RefCell`]: core::cell::RefCell
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use super::Recover;
15
15
16
16
// FIXME(conventions): implement bounded iterators
17
17
18
- /// A set based on a B-Tree.
18
+ /// An ordered set based on a B-Tree.
19
19
///
20
20
/// See [`BTreeMap`]'s documentation for a detailed discussion of this collection's performance
21
21
/// benefits and drawbacks.
@@ -27,6 +27,9 @@ use super::Recover;
27
27
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
28
28
/// behavior.
29
29
///
30
+ /// Entries in a `BTreeSet` are stored in ascending order according to the [`Ord`] implementation on the key.
31
+ /// Thus, iteration methods are guaranteed to produce iterators that yield items in that order.
32
+ ///
30
33
/// [`Ord`]: core::cmp::Ord
31
34
/// [`Cell`]: core::cell::Cell
32
35
/// [`RefCell`]: core::cell::RefCell
Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ pub mod vec_deque;
14
14
#[ cfg( not( no_global_oom_handling) ) ]
15
15
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
16
16
pub mod btree_map {
17
- //! A map based on a B-Tree.
17
+ //! An ordered map based on a B-Tree.
18
18
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
19
19
pub use super :: btree:: map:: * ;
20
20
}
21
21
22
22
#[ cfg( not( no_global_oom_handling) ) ]
23
23
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
24
24
pub mod btree_set {
25
- //! A set based on a B-Tree.
25
+ //! An ordered set based on a B-Tree.
26
26
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27
27
pub use super :: btree:: set:: * ;
28
28
}
You can’t perform that action at this time.
0 commit comments