From d0693218a1f78dda4871ddae038811ea06124a53 Mon Sep 17 00:00:00 2001 From: Alex Shelkovnykov Date: Sun, 17 Dec 2023 12:18:09 -0300 Subject: [PATCH] interpreter: fix minor bug unwrap_or is eagerly evaluated; we want unwrap_or_else which is lazily evaluated. --- rust/ares/src/interpreter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/ares/src/interpreter.rs b/rust/ares/src/interpreter.rs index 7558754..186ba3d 100644 --- a/rust/ares/src/interpreter.rs +++ b/rust/ares/src/interpreter.rs @@ -908,10 +908,10 @@ pub fn interpret(context: &mut Context, mut subject: Noun, formula: Noun) -> Res }, }, Err(error) => match error { - Error::Deterministic(trace) | Error::ScryCrashed(trace) => { + Error::Deterministic(_, trace) | Error::ScryCrashed(trace) => { break Err(Error::ScryCrashed(trace)); } - Error::NonDeterministic(_) => { + Error::NonDeterministic(_, _) => { break Err(error); } Error::ScryBlocked(_) => {