Fix positioning on unwrap_void

This commit is contained in:
microproofs 2024-09-01 20:15:03 -04:00 committed by Kasey
parent 2be76d7cda
commit a6bc0f7157
1 changed files with 3 additions and 5 deletions

View File

@ -981,11 +981,9 @@ pub fn unknown_data_to_type(term: Term<Name>, field_type: &Type) -> Term<Name> {
.lambda("__list_data") .lambda("__list_data")
.apply(Term::unlist_data().apply(term)), .apply(Term::unlist_data().apply(term)),
Some(UplcType::Bool) => Term::unwrap_bool_or(term, |result| result, &Term::Error.delay()), Some(UplcType::Bool) => Term::unwrap_bool_or(term, |result| result, &Term::Error.delay()),
Some(UplcType::Unit) => Term::unwrap_void_or( Some(UplcType::Unit) => term.as_var("val", |val| {
term.as_var("val", |val| Term::Var(val)), Term::Var(val).unwrap_void_or(|result| result, &Term::Error.delay())
|result| result, }),
&Term::Error.delay(),
),
Some(UplcType::Data) | None => term, Some(UplcType::Data) | None => term,
} }