fixup! refactor(core/rust): move InputStream to its own module

pull/3491/head
matejcik 5 months ago
parent 6c46c895ea
commit 13c577204c

@ -19,7 +19,7 @@ impl<'a> InputStream<'a> {
Ok(Self::new(buf))
}
pub fn read(&mut self, len: usize) -> Result<&[u8], Error> {
pub fn read(&mut self, len: usize) -> Result<&'a [u8], Error> {
let buf = self
.buf
.get(self.pos..self.pos + len)
@ -37,11 +37,7 @@ impl<'a> InputStream<'a> {
}
pub fn read_byte(&mut self) -> Result<u8, Error> {
let val = self
.buf
.get(self.pos)
.copied()
.ok_or(Error::EOFError)?;
let val = self.buf.get(self.pos).copied().ok_or(Error::EOFError)?;
self.pos += 1;
Ok(val)
}

Loading…
Cancel
Save