diff --git a/crates/uplc/src/machine.rs b/crates/uplc/src/machine.rs index a3a7ed3b..f8c60736 100644 --- a/crates/uplc/src/machine.rs +++ b/crates/uplc/src/machine.rs @@ -103,10 +103,13 @@ impl Machine { } fn return_compute(&mut self, value: Value) -> Result, Error> { - // avoid unwrap if possible and just return an err when None - // but honestly it should never be empty anyways because Machine + // frames should never be empty anyways because Machine // is initialized with `Context::NoFrame`. - let frame = self.frames.last().cloned().unwrap(); + let frame = self + .frames + .last() + .cloned() + .expect("frames should never be empty"); match frame { Context::FrameApplyFun(function) => {