Skip to content

Commit a80c3e6

Browse files
committed
Update diff_count serialization test to use less clowny padding
approach.
1 parent 42f76b8 commit a80c3e6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

crates/geo_filters/src/diff_count.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,14 +633,14 @@ mod tests {
633633
// Insert some padding to emulate alignment issues with the slices
634634
// A previous version of this test never panicked even though we were
635635
// violating the alignment preconditions for the `from_raw_parts` function
636-
let pad = (0..8).choose(&mut rnd).unwrap();
637-
for _ in 0..pad {
638-
writer.write(&[0x0]).unwrap();
639-
}
636+
let padding = [0_u8; 8];
637+
let pad_amount = (0..8).choose(&mut rnd).unwrap();
638+
writer.write_all(&padding[..pad_amount]).unwrap();
640639

641640
before.write(&mut writer).unwrap();
642641

643-
let after = GeoDiffCount::<'_, C>::from_bytes(before.config.clone(), &writer[pad..]);
642+
let after =
643+
GeoDiffCount::<'_, C>::from_bytes(before.config.clone(), &writer[pad_amount..]);
644644

645645
assert_eq!(before, after);
646646
}

0 commit comments

Comments
 (0)