This commit is contained in:
Trinity Pointard 2021-04-06 02:54:00 +02:00 committed by Alex Auvolat
parent 9c9471c64f
commit ae4982c309
No known key found for this signature in database
GPG key ID: EDABF9711E244EB1

View file

@ -302,7 +302,13 @@ impl BodyChunker {
if self.buf.len() == 0 {
Ok(None)
} else {
let mut iter = FastCDC::with_eof(self.buf.make_contiguous(), self.min_block_size, self.avg_block_size, self.max_block_size, self.read_all);
let mut iter = FastCDC::with_eof(
self.buf.make_contiguous(),
self.min_block_size,
self.avg_block_size,
self.max_block_size,
self.read_all,
);
if let Some(Chunk { length, .. }) = iter.next() {
let block = self.buf.drain(..length).collect::<Vec<u8>>();
Ok(Some(block))