@@ -386,7 +386,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
386386
387387 /// Borrows a view into the keys stored in the node.
388388 /// The caller must ensure that the node is not the shared root.
389- pub fn keys ( & self ) -> & [ K ] {
389+ pub unsafe fn keys ( & self ) -> & [ K ] {
390390 self . reborrow ( ) . into_key_slice ( )
391391 }
392392
@@ -521,10 +521,10 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
521521
522522impl < ' a , K : ' a , V : ' a , Type > NodeRef < marker:: Immut < ' a > , K , V , Type > {
523523 /// The caller must ensure that the node is not the shared root.
524- fn into_key_slice ( self ) -> & ' a [ K ] {
524+ unsafe fn into_key_slice ( self ) -> & ' a [ K ] {
525525 debug_assert ! ( !self . is_shared_root( ) ) ;
526526 // We cannot be the shared root, so `as_leaf` is okay.
527- unsafe { slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . keys ) , self . len ( ) ) }
527+ slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . keys ) , self . len ( ) )
528528 }
529529
530530 /// The caller must ensure that the node is not the shared root.
@@ -537,7 +537,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
537537 /// 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 ) } ;
540- ( k. into_key_slice ( ) , self . into_val_slice ( ) )
540+ ( unsafe { k. into_key_slice ( ) } , self . into_val_slice ( ) )
541541 }
542542}
543543
0 commit comments