diff --git a/pulley/src/decode.rs b/pulley/src/decode.rs index 09f4da80d901..54c84304f1c5 100644 --- a/pulley/src/decode.rs +++ b/pulley/src/decode.rs @@ -147,13 +147,13 @@ impl<'a> SafeBytecodeStream<'a> { impl BytecodeStream for SafeBytecodeStream<'_> { fn read(&mut self) -> Result<[u8; N], Self::Error> { - let bytes = *self + let (bytes, rest) = self .bytecode - .first_chunk::() + .split_first_chunk() .ok_or_else(|| self.unexpected_eof())?; - self.bytecode = &self.bytecode[N..]; + self.bytecode = rest; self.position += N; - Ok(bytes) + Ok(*bytes) } type Error = DecodingError;