@@ -75,24 +75,21 @@ fn slot_index_exhaustive() {
75
75
for idx in 0 ..=u32:: MAX {
76
76
buckets[ SlotIndex :: from_index ( idx) . bucket_idx ] += 1 ;
77
77
}
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 {
80
83
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) ;
87
86
} else {
88
- assert_eq ! ( idx, 0 ) ;
89
87
assert_eq ! ( slot_idx. index_in_bucket, 0 ) ;
90
- assert_eq ! ( slot_idx. bucket_idx, 0 ) ;
91
88
}
92
89
93
90
assert_eq ! ( buckets[ slot_idx. bucket_idx] , slot_idx. entries as u32 ) ;
94
91
assert_eq ! ( ENTRIES_BY_BUCKET [ slot_idx. bucket_idx] , slot_idx. entries, "{}" , idx) ;
95
92
96
- prev = Some ( slot_idx) ;
93
+ prev = slot_idx;
97
94
}
98
95
}
0 commit comments