@@ -466,12 +466,6 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
466
466
fn into_val_slice ( self ) -> & ' a [ V ] {
467
467
unsafe { slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . vals ) , self . len ( ) ) }
468
468
}
469
-
470
- fn into_slices ( self ) -> ( & ' a [ K ] , & ' a [ V ] ) {
471
- // SAFETY: equivalent to reborrow() except not requiring Type: 'a
472
- let k = unsafe { ptr:: read ( & self ) } ;
473
- ( k. into_key_slice ( ) , self . into_val_slice ( ) )
474
- }
475
469
}
476
470
477
471
impl < ' a , K : ' a , V : ' a , Type > NodeRef < marker:: Mut < ' a > , K , V , Type > {
@@ -980,10 +974,9 @@ impl<BorrowType, K, V> Handle<NodeRef<BorrowType, K, V, marker::Internal>, marke
980
974
981
975
impl < ' a , K : ' a , V : ' a , NodeType > Handle < NodeRef < marker:: Immut < ' a > , K , V , NodeType > , marker:: KV > {
982
976
pub fn into_kv ( self ) -> ( & ' a K , & ' a V ) {
983
- unsafe {
984
- let ( keys, vals) = self . node . into_slices ( ) ;
985
- ( keys. get_unchecked ( self . idx ) , vals. get_unchecked ( self . idx ) )
986
- }
977
+ let keys = self . node . into_key_slice ( ) ;
978
+ let vals = self . node . into_val_slice ( ) ;
979
+ unsafe { ( keys. get_unchecked ( self . idx ) , vals. get_unchecked ( self . idx ) ) }
987
980
}
988
981
}
989
982
0 commit comments