diff --git a/library/alloc/src/collections/btree/navigate.rs b/library/alloc/src/collections/btree/navigate.rs index 1ef2a572ddd91..259b22e5c6666 100644 --- a/library/alloc/src/collections/btree/navigate.rs +++ b/library/alloc/src/collections/btree/navigate.rs @@ -103,7 +103,8 @@ where } } -/// Equivalent to `range_search(k, v, ..)` but without the `Ord` bound. +/// Equivalent to `range_search(root1, root2, ..)` but without the `Ord` bound. +/// Equivalent to `(root1.first_leaf_edge(), root2.last_leaf_edge())` but more efficient. fn full_range( root1: NodeRef, root2: NodeRef, @@ -130,7 +131,7 @@ fn full_range( } impl<'a, K: 'a, V: 'a> NodeRef, K, V, marker::LeafOrInternal> { - /// Creates a pair of leaf edges delimiting a specified range in or underneath a node. + /// Finds the pair of leaf edges delimiting a specific range in a tree. /// /// The result is meaningful only if the tree is ordered by key, like the tree /// in a `BTreeMap` is. @@ -149,7 +150,7 @@ impl<'a, K: 'a, V: 'a> NodeRef, K, V, marker::LeafOrInternal> range_search(self, self, range) } - /// Returns (self.first_leaf_edge(), self.last_leaf_edge()), but more efficiently. + /// Finds the pair of leaf edges delimiting an entire tree. pub fn full_range( self, ) -> ( diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 1d632512c78b4..6f67aadc161f1 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -169,7 +169,7 @@ impl NodeRef { NodeRef { height: self.height, node: self.node, _marker: PhantomData } } - /// Irreversibly transistions to a reference that offers traversal, + /// Irreversibly transitions to a reference that permits traversal and offers /// destructive methods and little else. pub fn into_dying(self) -> NodeRef { NodeRef { height: self.height, node: self.node, _marker: PhantomData }