From b3cb9c4510e607b13cab64858cbe62d37345060e Mon Sep 17 00:00:00 2001 From: Kasey White Date: Sun, 24 Jul 2022 19:47:13 -0400 Subject: [PATCH] use expect instead of unwrap --- crates/uplc/src/machine.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) => {