@@ -386,7 +386,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
386
386
387
387
/// Borrows a view into the keys stored in the node.
388
388
/// 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 ] {
390
390
self . reborrow ( ) . into_key_slice ( )
391
391
}
392
392
@@ -521,10 +521,10 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
521
521
522
522
impl < ' a , K : ' a , V : ' a , Type > NodeRef < marker:: Immut < ' a > , K , V , Type > {
523
523
/// 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 ] {
525
525
debug_assert ! ( !self . is_shared_root( ) ) ;
526
526
// 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 ( ) )
528
528
}
529
529
530
530
/// 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> {
537
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
- ( k. into_key_slice ( ) , self . into_val_slice ( ) )
540
+ ( unsafe { k. into_key_slice ( ) } , self . into_val_slice ( ) )
541
541
}
542
542
}
543
543
0 commit comments