This commit is contained in:
Bradlee Speice 2019-04-29 14:06:41 -04:00
parent 7a8cf71285
commit 9c3294ebcb

View File

@ -244,7 +244,9 @@ impl<'a> KStream for BytesReader<'a> {
fn read_bytes(&self, len: usize) -> KResult<&[u8]> {
let cur_pos = self.state.borrow().pos;
if len + cur_pos > self.bytes.len() {
return Err(KError::Incomplete(Needed::Size(len + cur_pos - self.bytes.len())));
return Err(KError::Incomplete(Needed::Size(
len + cur_pos - self.bytes.len(),
)));
}
self.state.borrow_mut().pos += len;