@@ -301,10 +301,10 @@ impl<K: Ord, V> BSTMap<K, V> {
301
301
Q : Ord + ?Sized ,
302
302
{
303
303
let mut current = self . root_mut ( ) ;
304
- while let Some ( mut node) = current. take ( ) {
304
+ while let Some ( node) = current. take ( ) {
305
305
match key. cmp ( node. key ( ) . borrow ( ) ) {
306
- Ordering :: Less => current = node. left ( ) ,
307
- Ordering :: Greater => current = node. right ( ) ,
306
+ Ordering :: Less => current = node. into_left ( ) ,
307
+ Ordering :: Greater => current = node. into_right ( ) ,
308
308
Ordering :: Equal => return Some ( node. into_value_mut ( ) ) ,
309
309
}
310
310
}
@@ -374,10 +374,10 @@ impl<K: Ord, V> BSTMap<K, V> {
374
374
Q : Ord + ?Sized ,
375
375
{
376
376
let mut current = self . root_mut ( ) ;
377
- while let Some ( mut node) = current {
377
+ while let Some ( node) = current {
378
378
match key. cmp ( node. key ( ) . borrow ( ) ) {
379
- Ordering :: Less => current = node. left ( ) ,
380
- Ordering :: Greater => current = node. right ( ) ,
379
+ Ordering :: Less => current = node. into_left ( ) ,
380
+ Ordering :: Greater => current = node. into_right ( ) ,
381
381
Ordering :: Equal => return Some ( node. into_entry_mut ( ) ) ,
382
382
}
383
383
}
@@ -422,7 +422,7 @@ impl<K: Ord, V> BSTMap<K, V> {
422
422
node. push_left ( key, value) ;
423
423
break ;
424
424
}
425
- current = node. left ( ) ;
425
+ current = node. into_left ( ) ;
426
426
} ,
427
427
428
428
Ordering :: Greater => {
@@ -431,7 +431,7 @@ impl<K: Ord, V> BSTMap<K, V> {
431
431
node. push_right ( key, value) ;
432
432
break ;
433
433
}
434
- current = node. right ( ) ;
434
+ current = node. into_right ( ) ;
435
435
} ,
436
436
437
437
Ordering :: Equal => {
0 commit comments