@@ -6,7 +6,6 @@ use core::ptr;
66
77use super :: node:: { marker, ForceResult :: * , Handle , NodeRef } ;
88use super :: search:: SearchResult ;
9- use super :: unwrap_unchecked;
109
1110/// Finds the leaf edges delimiting a specified range in or underneath a node.
1211///
@@ -310,7 +309,7 @@ macro_rules! def_next_kv_uncheched_dealloc {
310309 Err ( last_edge) => {
311310 unsafe {
312311 let parent_edge = last_edge. into_node( ) . deallocate_and_ascend( ) ;
313- unwrap_unchecked( parent_edge ) . forget_node_type( )
312+ parent_edge . unwrap_unchecked( ) . forget_node_type( )
314313 }
315314 }
316315 }
@@ -331,7 +330,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Ed
331330 pub unsafe fn next_unchecked ( & mut self ) -> ( & ' a K , & ' a V ) {
332331 super :: mem:: replace ( self , |leaf_edge| {
333332 let kv = leaf_edge. next_kv ( ) ;
334- let kv = unsafe { unwrap_unchecked ( kv. ok ( ) ) } ;
333+ let kv = unsafe { kv. ok ( ) . unwrap_unchecked ( ) } ;
335334 ( kv. next_leaf_edge ( ) , kv. into_kv ( ) )
336335 } )
337336 }
@@ -344,7 +343,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Ed
344343 pub unsafe fn next_back_unchecked ( & mut self ) -> ( & ' a K , & ' a V ) {
345344 super :: mem:: replace ( self , |leaf_edge| {
346345 let kv = leaf_edge. next_back_kv ( ) ;
347- let kv = unsafe { unwrap_unchecked ( kv. ok ( ) ) } ;
346+ let kv = unsafe { kv. ok ( ) . unwrap_unchecked ( ) } ;
348347 ( kv. next_back_leaf_edge ( ) , kv. into_kv ( ) )
349348 } )
350349 }
@@ -359,7 +358,7 @@ impl<'a, K, V> Handle<NodeRef<marker::ValMut<'a>, K, V, marker::Leaf>, marker::E
359358 pub unsafe fn next_unchecked ( & mut self ) -> ( & ' a K , & ' a mut V ) {
360359 let kv = super :: mem:: replace ( self , |leaf_edge| {
361360 let kv = leaf_edge. next_kv ( ) ;
362- let kv = unsafe { unwrap_unchecked ( kv. ok ( ) ) } ;
361+ let kv = unsafe { kv. ok ( ) . unwrap_unchecked ( ) } ;
363362 ( unsafe { ptr:: read ( & kv) } . next_leaf_edge ( ) , kv)
364363 } ) ;
365364 // Doing this last is faster, according to benchmarks.
@@ -374,7 +373,7 @@ impl<'a, K, V> Handle<NodeRef<marker::ValMut<'a>, K, V, marker::Leaf>, marker::E
374373 pub unsafe fn next_back_unchecked ( & mut self ) -> ( & ' a K , & ' a mut V ) {
375374 let kv = super :: mem:: replace ( self , |leaf_edge| {
376375 let kv = leaf_edge. next_back_kv ( ) ;
377- let kv = unsafe { unwrap_unchecked ( kv. ok ( ) ) } ;
376+ let kv = unsafe { kv. ok ( ) . unwrap_unchecked ( ) } ;
378377 ( unsafe { ptr:: read ( & kv) } . next_back_leaf_edge ( ) , kv)
379378 } ) ;
380379 // Doing this last is faster, according to benchmarks.
0 commit comments