From 1b800a567165ab4395daa82e215eaed84be5c8dc Mon Sep 17 00:00:00 2001 From: Stein Somers Date: Tue, 21 Jan 2020 10:30:14 +0100 Subject: [PATCH] trade in outdated comments for correct ones --- src/liballoc/collections/btree/node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index f190209503d3..37501a51e16e 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -392,7 +392,6 @@ impl NodeRef { /// 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, 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, K, V, Type> { } impl<'a, K: 'a, V: 'a, Type> NodeRef, 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, 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())