@@ -75,24 +75,21 @@ fn slot_index_exhaustive() {
7575 for idx in 0 ..=u32:: MAX {
7676 buckets[ SlotIndex :: from_index ( idx) . bucket_idx ] += 1 ;
7777 }
78- let mut prev = None :: < SlotIndex > ;
79- for idx in 0 ..=u32:: MAX {
78+ let slot_idx = SlotIndex :: from_index ( 0 ) ;
79+ assert_eq ! ( slot_idx. index_in_bucket, 0 ) ;
80+ assert_eq ! ( slot_idx. bucket_idx, 0 ) ;
81+ let mut prev = slot_idx;
82+ for idx in 1 ..=u32:: MAX {
8083 let slot_idx = SlotIndex :: from_index ( idx) ;
81- if let Some ( p) = prev {
82- if p. bucket_idx == slot_idx. bucket_idx {
83- assert_eq ! ( p. index_in_bucket + 1 , slot_idx. index_in_bucket) ;
84- } else {
85- assert_eq ! ( slot_idx. index_in_bucket, 0 ) ;
86- }
84+ if prev. bucket_idx == slot_idx. bucket_idx {
85+ assert_eq ! ( prev. index_in_bucket + 1 , slot_idx. index_in_bucket) ;
8786 } else {
88- assert_eq ! ( idx, 0 ) ;
8987 assert_eq ! ( slot_idx. index_in_bucket, 0 ) ;
90- assert_eq ! ( slot_idx. bucket_idx, 0 ) ;
9188 }
9289
9390 assert_eq ! ( buckets[ slot_idx. bucket_idx] , slot_idx. entries as u32 ) ;
9491 assert_eq ! ( ENTRIES_BY_BUCKET [ slot_idx. bucket_idx] , slot_idx. entries, "{}" , idx) ;
9592
96- prev = Some ( slot_idx) ;
93+ prev = slot_idx;
9794 }
9895}
0 commit comments