catar/encoder.rs: make sure we write all data with write_all()
This commit is contained in:
parent
050f8a6355
commit
c7fa487250
|
@ -58,13 +58,13 @@ impl <'a, W: Write> CaTarEncoder<'a, W> {
|
|||
}
|
||||
|
||||
fn write(&mut self, buf: &[u8]) -> Result<(), Error> {
|
||||
self.writer.write(buf)?;
|
||||
self.writer.write_all(buf)?;
|
||||
self.writer_pos += buf.len();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn flush_copy_buffer(&mut self, size: usize) -> Result<(), Error> {
|
||||
self.writer.write(&self.file_copy_buffer[..size])?;
|
||||
self.writer.write_all(&self.file_copy_buffer[..size])?;
|
||||
self.writer_pos += size;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue