update a chunk of stuff to the hyper release

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2019-12-12 15:27:07 +01:00
parent 3f1020b732
commit db0cb9ce0b
23 changed files with 253 additions and 164 deletions

View File

@ -60,7 +60,7 @@ where
None => {
this.scan_pos = 0;
if this.buffer.len() > 0 {
return Poll::Ready(Some(Ok(this.buffer.take())));
return Poll::Ready(Some(Ok(this.buffer.split())));
} else {
return Poll::Ready(None);
}
@ -99,7 +99,7 @@ where
let this = self.get_mut();
loop {
if this.buffer.len() == this.chunk_size {
return Poll::Ready(Some(Ok(this.buffer.take())));
return Poll::Ready(Some(Ok(this.buffer.split())));
} else if this.buffer.len() > this.chunk_size {
let result = this.buffer.split_to(this.chunk_size);
return Poll::Ready(Some(Ok(result)));
@ -112,7 +112,7 @@ where
None => {
// last chunk can have any size
if this.buffer.len() > 0 {
return Poll::Ready(Some(Ok(this.buffer.take())));
return Poll::Ready(Some(Ok(this.buffer.split())));
} else {
return Poll::Ready(None);
}