Add/use create_wasi_instance() instead of instantiate_wasi(). (#571)

* Add/use create_wasi_instance() instead of instantiate_wasi().

* rm Result from Instance::from_handle
This commit is contained in:
Yury Delendik
2019-11-15 18:48:05 -06:00
committed by Dan Gohman
parent 9896a5cabd
commit ea56118651
8 changed files with 36 additions and 39 deletions

View File

@@ -121,10 +121,7 @@ impl Instance {
Some(&self.exports()[i])
}
pub fn from_handle(
store: &HostRef<Store>,
instance_handle: InstanceHandle,
) -> Result<Instance> {
pub fn from_handle(store: &HostRef<Store>, instance_handle: InstanceHandle) -> Instance {
let contexts = HashSet::new();
let mut exports = Vec::new();
@@ -152,12 +149,12 @@ impl Instance {
exports_types.into_boxed_slice(),
));
Ok(Instance {
Instance {
instance_handle,
module,
contexts,
exports: exports.into_boxed_slice(),
})
}
}
pub fn handle(&self) -> &InstanceHandle {