File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,19 +60,13 @@ macro_rules! fill_via_chunks {
6060 let chunk_size = ( chunk_size_u8 + SIZE - 1 ) / SIZE ;
6161
6262 let mut iter_src = $src. iter( ) ;
63- let mut iter_chunks = $dst. chunks_exact_mut( SIZE ) ;
64- let mut n;
65- loop {
66- n = iter_src. next( ) ;
67- if let ( Some ( n_) , Some ( chunk) ) = ( n, iter_chunks. next( ) ) {
68- chunk. copy_from_slice( & n_. to_le_bytes( ) ) ;
69- } else {
70- break ;
71- }
63+ let mut chunks = $dst. chunks_exact_mut( SIZE ) ;
64+ for ( chunk, n) in ( & mut chunks) . zip( & mut iter_src) {
65+ chunk. copy_from_slice( & n. to_le_bytes( ) ) ;
7266 }
73- let rem = iter_chunks . into_remainder( ) ;
74- if let Some ( n_ ) = n {
75- rem. copy_from_slice( & n_ . to_le_bytes( ) [ ..rem. len( ) ] ) ;
67+ let rem = chunks . into_remainder( ) ;
68+ if let Some ( n ) = iter_src . next ( ) {
69+ rem. copy_from_slice( & n . to_le_bytes( ) [ ..rem. len( ) ] ) ;
7670 }
7771
7872 ( chunk_size, chunk_size_u8)
You can’t perform that action at this time.
0 commit comments