Skip to content

Commit f7edf5c

Browse files
committed
BTreeMap: fix internal comments
1 parent f4008fe commit f7edf5c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

library/alloc/src/collections/btree/navigate.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ where
103103
}
104104
}
105105

106-
/// Equivalent to `range_search(k, v, ..)` but without the `Ord` bound.
106+
/// Equivalent to `range_search(root1, root2, ..)` but without the `Ord` bound.
107+
/// Equivalent to `(root1.first_leaf_edge(), root2.last_leaf_edge())` but more efficient.
107108
fn full_range<BorrowType: marker::BorrowType, K, V>(
108109
root1: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
109110
root2: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
@@ -130,7 +131,7 @@ fn full_range<BorrowType: marker::BorrowType, K, V>(
130131
}
131132

132133
impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> {
133-
/// Creates a pair of leaf edges delimiting a specified range in or underneath a node.
134+
/// Finds the pair of leaf edges delimiting a specific range in a tree.
134135
///
135136
/// The result is meaningful only if the tree is ordered by key, like the tree
136137
/// in a `BTreeMap` is.
@@ -149,7 +150,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal>
149150
range_search(self, self, range)
150151
}
151152

152-
/// Returns (self.first_leaf_edge(), self.last_leaf_edge()), but more efficiently.
153+
/// Finds the pair of leaf edges delimiting an entire tree.
153154
pub fn full_range(
154155
self,
155156
) -> (

library/alloc/src/collections/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<K, V, Type> NodeRef<marker::Owned, K, V, Type> {
169169
NodeRef { height: self.height, node: self.node, _marker: PhantomData }
170170
}
171171

172-
/// Irreversibly transistions to a reference that offers traversal,
172+
/// Irreversibly transitions to a reference that permits traversal and offers
173173
/// destructive methods and little else.
174174
pub fn into_dying(self) -> NodeRef<marker::Dying, K, V, Type> {
175175
NodeRef { height: self.height, node: self.node, _marker: PhantomData }

0 commit comments

Comments
 (0)