@@ -395,9 +395,6 @@ impl<K, V, M: Deref<Target=RawTable<K, V>> + DerefMut> FullBucket<K, V, M> {
395
395
/// This works similarly to `put`, building an `EmptyBucket` out of the
396
396
/// taken bucket.
397
397
pub fn take ( mut self ) -> ( EmptyBucket < K , V , M > , K , V ) {
398
- let key = self . raw . key as * const K ;
399
- let val = self . raw . val as * const V ;
400
-
401
398
self . table . size -= 1 ;
402
399
403
400
unsafe {
@@ -408,8 +405,8 @@ impl<K, V, M: Deref<Target=RawTable<K, V>> + DerefMut> FullBucket<K, V, M> {
408
405
idx : self . idx ,
409
406
table : self . table
410
407
} ,
411
- ptr:: read ( key) ,
412
- ptr:: read ( val)
408
+ ptr:: read ( self . raw . key ) ,
409
+ ptr:: read ( self . raw . val )
413
410
)
414
411
}
415
412
}
@@ -477,8 +474,8 @@ impl<K, V, M: Deref<Target=RawTable<K, V>>> GapThenFull<K, V, M> {
477
474
pub fn shift ( mut self ) -> Option < GapThenFull < K , V , M > > {
478
475
unsafe {
479
476
* self . gap . raw . hash = mem:: replace ( & mut * self . full . raw . hash , EMPTY_BUCKET ) ;
480
- copy_nonoverlapping_memory ( self . gap . raw . key , self . full . raw . key as * const K , 1 ) ;
481
- copy_nonoverlapping_memory ( self . gap . raw . val , self . full . raw . val as * const V , 1 ) ;
477
+ copy_nonoverlapping_memory ( self . gap . raw . key , self . full . raw . key , 1 ) ;
478
+ copy_nonoverlapping_memory ( self . gap . raw . val , self . full . raw . val , 1 ) ;
482
479
}
483
480
484
481
let FullBucket { raw : prev_raw, idx : prev_idx, .. } = self . full ;
@@ -781,8 +778,8 @@ impl<'a, K, V> Iterator for RevMoveBuckets<'a, K, V> {
781
778
if * self . raw . hash != EMPTY_BUCKET {
782
779
self . elems_left -= 1 ;
783
780
return Some ( (
784
- ptr:: read ( self . raw . key as * const K ) ,
785
- ptr:: read ( self . raw . val as * const V )
781
+ ptr:: read ( self . raw . key ) ,
782
+ ptr:: read ( self . raw . val )
786
783
) ) ;
787
784
}
788
785
}
@@ -878,8 +875,8 @@ impl<K, V> Iterator for IntoIter<K, V> {
878
875
SafeHash {
879
876
hash : * bucket. hash ,
880
877
} ,
881
- ptr:: read ( bucket. key as * const K ) ,
882
- ptr:: read ( bucket. val as * const V )
878
+ ptr:: read ( bucket. key ) ,
879
+ ptr:: read ( bucket. val )
883
880
)
884
881
}
885
882
} )
@@ -906,8 +903,8 @@ impl<'a, K, V> Iterator for Drain<'a, K, V> {
906
903
SafeHash {
907
904
hash : ptr:: replace ( bucket. hash , EMPTY_BUCKET ) ,
908
905
} ,
909
- ptr:: read ( bucket. key as * const K ) ,
910
- ptr:: read ( bucket. val as * const V )
906
+ ptr:: read ( bucket. key ) ,
907
+ ptr:: read ( bucket. val )
911
908
)
912
909
}
913
910
} )
0 commit comments