@@ -392,7 +392,6 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
392392
393393 /// Borrows a view into the values stored in the node.
394394 /// The caller must ensure that the node is not the shared root.
395- /// This function is not public, so doesn't have to support shared roots like `keys` does.
396395 fn vals ( & self ) -> & [ V ] {
397396 self . reborrow ( ) . into_val_slice ( )
398397 }
@@ -510,7 +509,6 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
510509 }
511510
512511 /// The caller must ensure that the node is not the shared root.
513- /// This function is not public, so doesn't have to support shared roots like `keys` does.
514512 fn keys_mut ( & mut self ) -> & mut [ K ] {
515513 unsafe { self . reborrow_mut ( ) . into_key_slice_mut ( ) }
516514 }
@@ -522,6 +520,7 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
522520}
523521
524522impl < ' a , K : ' a , V : ' a , Type > NodeRef < marker:: Immut < ' a > , K , V , Type > {
523+ /// The caller must ensure that the node is not the shared root.
525524 fn into_key_slice ( self ) -> & ' a [ K ] {
526525 debug_assert ! ( !self . is_shared_root( ) ) ;
527526 // 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> {
535534 unsafe { slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . vals ) , self . len ( ) ) }
536535 }
537536
537+ /// The caller must ensure that the node is not the shared root.
538538 fn into_slices ( self ) -> ( & ' a [ K ] , & ' a [ V ] ) {
539539 let k = unsafe { ptr:: read ( & self ) } ;
540540 ( k. into_key_slice ( ) , self . into_val_slice ( ) )
0 commit comments