about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorStein Somers <git@steinsomers.be>2020-01-21 10:30:14 +0100
committerStein Somers <git@steinsomers.be>2020-01-21 10:30:14 +0100
commit1b800a567165ab4395daa82e215eaed84be5c8dc (patch)
treec8b335848e3f2c43647f23a839dac28d2be0cfd5 /src/liballoc
parent9e90840a6ae4a6f61781bd80adea825d156ddffa (diff)
downloadrust-1b800a567165ab4395daa82e215eaed84be5c8dc.tar.gz
rust-1b800a567165ab4395daa82e215eaed84be5c8dc.zip
trade in outdated comments for correct ones
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/btree/node.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs
index f190209503d..37501a51e16 100644
--- a/src/liballoc/collections/btree/node.rs
+++ b/src/liballoc/collections/btree/node.rs
@@ -392,7 +392,6 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
 
     /// Borrows a view into the values stored in the node.
     /// The caller must ensure that the node is not the shared root.
-    /// This function is not public, so doesn't have to support shared roots like `keys` does.
     fn vals(&self) -> &[V] {
         self.reborrow().into_val_slice()
     }
@@ -510,7 +509,6 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
     }
 
     /// The caller must ensure that the node is not the shared root.
-    /// This function is not public, so doesn't have to support shared roots like `keys` does.
     fn keys_mut(&mut self) -> &mut [K] {
         unsafe { self.reborrow_mut().into_key_slice_mut() }
     }
@@ -522,6 +520,7 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
 }
 
 impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
+    /// The caller must ensure that the node is not the shared root.
     fn into_key_slice(self) -> &'a [K] {
         debug_assert!(!self.is_shared_root());
         // We cannot be the shared root, so `as_leaf` is okay.
@@ -535,6 +534,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
         unsafe { slice::from_raw_parts(MaybeUninit::first_ptr(&self.as_leaf().vals), self.len()) }
     }
 
+    /// The caller must ensure that the node is not the shared root.
     fn into_slices(self) -> (&'a [K], &'a [V]) {
         let k = unsafe { ptr::read(&self) };
         (k.into_key_slice(), self.into_val_slice())