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, }