about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-02-14 16:54:49 +0100
committerGitHub <noreply@github.com>2021-02-14 16:54:49 +0100
commit4e888bf4035981c002dbf41b461297a90e428f18 (patch)
tree858130888034c066b35ee5a2876d456852ab1f5f
parenta6809d00aed27db9ac99841d2bd34060a77d2708 (diff)
parentf7edf5ce051e64c2d392e19819542e177867e714 (diff)
downloadrust-4e888bf4035981c002dbf41b461297a90e428f18.tar.gz
rust-4e888bf4035981c002dbf41b461297a90e428f18.zip
Rollup merge of #81919 - ssomers:btree_cleanup_comments, r=Mark-Simulacrum
BTreeMap: fix internal comments

Salvaged from #81372

r? `@Mark-Simulacrum`
-rw-r--r--library/alloc/src/collections/btree/navigate.rs7
-rw-r--r--library/alloc/src/collections/btree/node.rs2
2 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/collections/btree/navigate.rs b/library/alloc/src/collections/btree/navigate.rs
index 43838578ca2..783c8024481 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<BorrowType: marker::BorrowType, K, V>(
     root1: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
     root2: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
@@ -130,7 +131,7 @@ fn full_range<BorrowType: marker::BorrowType, K, V>(
 }
 
 impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, 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<marker::Immut<'a>, 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 50d6fb11b11..4fc32305f1e 100644
--- a/library/alloc/src/collections/btree/node.rs
+++ b/library/alloc/src/collections/btree/node.rs
@@ -181,7 +181,7 @@ impl<K, V, Type> NodeRef<marker::Owned, K, V, Type> {
         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<marker::Dying, K, V, Type> {
         NodeRef { height: self.height, node: self.node, _marker: PhantomData }