fix: fixes according to PR comments

- Reset previous implementation of InMemoryExampleStorage
- Implement default (empty) behaviour of on_piece_completed in trait
  itself
- Now passing a ValidPieceIndex in on_piece_completed
This commit is contained in:
LIAUD Corentin 2024-08-28 08:26:06 +02:00
parent 35d57ae8a2
commit 9183df0ebd
No known key found for this signature in database
GPG key ID: 48D3490FB1A44E6A
6 changed files with 19 additions and 79 deletions

View file

@ -215,7 +215,7 @@ impl<'a> FileOps<'a> {
format!("error reading {to_read_in_file} bytes, file_id: {file_idx} (\"{name:?}\")")
})?;
self.files.on_piece_completed(file_idx, absolute_offset)?;
self.files.on_piece_completed(piece_index)?;
piece_remaining_bytes -= to_read_in_file;