@@ -392,7 +392,6 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
392
392
393
393
/// Borrows a view into the values stored in the node.
394
394
/// 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.
396
395
fn vals ( & self ) -> & [ V ] {
397
396
self . reborrow ( ) . into_val_slice ( )
398
397
}
@@ -510,7 +509,6 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
510
509
}
511
510
512
511
/// 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.
514
512
fn keys_mut ( & mut self ) -> & mut [ K ] {
515
513
unsafe { self . reborrow_mut ( ) . into_key_slice_mut ( ) }
516
514
}
@@ -522,6 +520,7 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
522
520
}
523
521
524
522
impl < ' 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.
525
524
fn into_key_slice ( self ) -> & ' a [ K ] {
526
525
debug_assert ! ( !self . is_shared_root( ) ) ;
527
526
// 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> {
535
534
unsafe { slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . vals ) , self . len ( ) ) }
536
535
}
537
536
537
+ /// The caller must ensure that the node is not the shared root.
538
538
fn into_slices ( self ) -> ( & ' a [ K ] , & ' a [ V ] ) {
539
539
let k = unsafe { ptr:: read ( & self ) } ;
540
540
( k. into_key_slice ( ) , self . into_val_slice ( ) )
0 commit comments