From 13c577204c9b8af55de8abf7d903e350d173a9ed Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 18 Jan 2024 10:28:43 +0100 Subject: [PATCH] fixup! refactor(core/rust): move InputStream to its own module --- core/embed/rust/src/io.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/embed/rust/src/io.rs b/core/embed/rust/src/io.rs index 0e46495ffd..0e8d5a64c7 100644 --- a/core/embed/rust/src/io.rs +++ b/core/embed/rust/src/io.rs @@ -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 { - 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) }