mirror of
https://github.com/bspeice/kaitai_rust
synced 2024-11-22 13:58:11 -05:00
Rustfmt
This commit is contained in:
parent
7a8cf71285
commit
9c3294ebcb
@ -244,11 +244,13 @@ impl<'a> KStream for BytesReader<'a> {
|
|||||||
fn read_bytes(&self, len: usize) -> KResult<&[u8]> {
|
fn read_bytes(&self, len: usize) -> KResult<&[u8]> {
|
||||||
let cur_pos = self.state.borrow().pos;
|
let cur_pos = self.state.borrow().pos;
|
||||||
if len + cur_pos > self.bytes.len() {
|
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;
|
self.state.borrow_mut().pos += len;
|
||||||
Ok(&self.bytes[cur_pos..cur_pos+len])
|
Ok(&self.bytes[cur_pos..cur_pos + len])
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_bytes_full(&self) -> KResult<&[u8]> {
|
fn read_bytes_full(&self) -> KResult<&[u8]> {
|
||||||
|
Loading…
Reference in New Issue
Block a user