Address reviewer comments

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2022-08-11 15:52:29 +01:00
parent 1a2122fff0
commit ac70aea985
18 changed files with 74 additions and 55 deletions

View File

@@ -323,10 +323,10 @@ where
Ok(n)
}
fn read_buf(&mut self, mut cursor: BorrowedCursor<'_, '_>) -> io::Result<()> {
fn read_buf(&mut self, mut cursor: BorrowedCursor<'_>) -> io::Result<()> {
let prev_written = cursor.written();
Read::read_buf(&mut self.fill_buf()?, cursor.clone())?;
Read::read_buf(&mut self.fill_buf()?, cursor.reborrow())?;
self.pos += (cursor.written() - prev_written) as u64;