We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ccc964 commit c919b79Copy full SHA for c919b79
src/main.rs
@@ -496,16 +496,17 @@ fn save_bhd_directory<T: FlashRead + FlashWrite>(
496
497
fn transfer_from_flash_to_io<T: FlashRead + FlashWrite>(
498
storage: &T,
499
- beginning: Location,
+ mut off: Location,
500
mut size: usize,
501
destination: &mut impl std::io::Write,
502
) {
503
let mut buffer = [0u8; 8192];
504
while size > 0 {
505
let chunk_size = min(buffer.len(), size);
506
- storage.read_exact(beginning, &mut buffer[..chunk_size]).unwrap();
+ storage.read_exact(off, &mut buffer[..chunk_size]).unwrap();
507
destination.write_all(&buffer[..chunk_size]).unwrap();
508
- size = size - chunk_size;
+ size -= chunk_size;
509
+ off += chunk_size as u32;
510
}
511
512
0 commit comments