Skip to content

Commit 0f16403

Browse files
committed
fixup! Handle fixed list with different API
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 3ab4cb1 commit 0f16403

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/hyperlight_component_util/src/elaborate.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -429,31 +429,28 @@ impl<'p, 'a> Ctx<'p, 'a> {
429429
Defined::Handleable(h) => Ok(Value::Borrow(h.clone())),
430430
_ => Err(Error::HandleToNonResource),
431431
},
432-
ComponentDefinedType::Future(_) | ComponentDefinedType::Stream(_) => {
433-
panic!("async not yet supported")
434-
}
435432
ComponentDefinedType::FixedSizeList(vt, size) => {
436433
Ok(Value::FixList(Box::new(self.elab_value(vt)?), *size))
434+
},
435+
ComponentDefinedType::Future(_) | ComponentDefinedType::Stream(_) => {
436+
panic!("async not yet supported")
437437
}
438438
}
439439
}
440440

441441
fn elab_func<'c>(&'c mut self, ft: &ComponentFuncType<'a>) -> Result<Func<'a>, Error<'a>> {
442442
Ok(Func {
443443
params: ft
444-
.params
445-
.iter()
446-
.map(|(n, vt)| {
447-
Ok(Param {
448-
name: Name { name: n },
449-
ty: self.elab_value(vt)?,
450-
})
444+
.params
445+
.iter()
446+
.map(|(n, vt)| {
447+
Ok(Param {
448+
name: Name { name: n },
449+
ty: self.elab_value(vt)?,
451450
})
452-
.collect::<Result<Vec<_>, Error<'a>>>()?,
453-
result: match &ft.result {
454-
Some(vt) => Some(self.elab_value(vt)?),
455-
None => None,
456-
},
451+
})
452+
.collect::<Result<Vec<_>, Error<'a>>>()?,
453+
result: ft.result.as_ref().map(|vt| self.elab_value(vt)).transpose()?,
457454
})
458455
}
459456

0 commit comments

Comments
 (0)