diff --git a/src/utils.rs b/src/utils.rs index 473836e..18f6bdd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -67,6 +67,6 @@ impl VariableDeclarationStack pub fn pop(&mut self) -> Result<(), crate::Error> { self.bound_variable_declaration_stack.pop().map(|_| ()) - .ok_or(crate::Error::new_logic("variable stack not in expected state")) + .ok_or_else(|| crate::Error::new_logic("variable stack not in expected state")) } }