mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-24 15:38:22 +00:00
fixup! refactor(core/rust): move InputStream to its own module
This commit is contained in:
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…
Reference in New Issue
Block a user