File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments