@@ -466,12 +466,6 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
466466 fn into_val_slice ( self ) -> & ' a [ V ] {
467467 unsafe { slice:: from_raw_parts ( MaybeUninit :: first_ptr ( & self . as_leaf ( ) . vals ) , self . len ( ) ) }
468468 }
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- }
475469}
476470
477471impl < ' 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
980974
981975impl < ' a , K : ' a , V : ' a , NodeType > Handle < NodeRef < marker:: Immut < ' a > , K , V , NodeType > , marker:: KV > {
982976 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 ) ) }
987980 }
988981}
989982
0 commit comments