From a6bc0f715765991b97b9838e91a105df06ec7703 Mon Sep 17 00:00:00 2001 From: microproofs Date: Sun, 1 Sep 2024 20:15:03 -0400 Subject: [PATCH] Fix positioning on unwrap_void --- crates/aiken-lang/src/gen_uplc/builder.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/aiken-lang/src/gen_uplc/builder.rs b/crates/aiken-lang/src/gen_uplc/builder.rs index ebc3be7a..5d7b1968 100644 --- a/crates/aiken-lang/src/gen_uplc/builder.rs +++ b/crates/aiken-lang/src/gen_uplc/builder.rs @@ -981,11 +981,9 @@ pub fn unknown_data_to_type(term: Term, field_type: &Type) -> Term { .lambda("__list_data") .apply(Term::unlist_data().apply(term)), Some(UplcType::Bool) => Term::unwrap_bool_or(term, |result| result, &Term::Error.delay()), - Some(UplcType::Unit) => Term::unwrap_void_or( - term.as_var("val", |val| Term::Var(val)), - |result| result, - &Term::Error.delay(), - ), + Some(UplcType::Unit) => term.as_var("val", |val| { + Term::Var(val).unwrap_void_or(|result| result, &Term::Error.delay()) + }), Some(UplcType::Data) | None => term, }