Force unwrap_xxx_or inside function body
Otherwise, it becomes the responsibility of the caller to force the result; which may be easily forgotten.
This commit is contained in:
@@ -932,8 +932,12 @@ pub fn unknown_data_to_type(term: Term<Name>, field_type: &Type) -> Term<Name> {
|
||||
)
|
||||
.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, |result| result, &Term::Error.delay()),
|
||||
Some(UplcType::Bool) => {
|
||||
Term::unwrap_bool_or(term, |result| result.delay(), &Term::Error.delay())
|
||||
}
|
||||
Some(UplcType::Unit) => {
|
||||
Term::unwrap_void_or(term, |result| result.delay(), &Term::Error.delay())
|
||||
}
|
||||
|
||||
Some(UplcType::Data) | None => term,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user