Don't require Store in Instance constructor (#810)
* Don't require `Store` in `Instance` constructor This can be inferred from the `Module` argument. Additionally add a `store` accessor to an `Instance` in case it's needed to instantiate another `Module`. cc #708 * Update more constructors * Fix a doctest * Don't ignore store in `wasm_instance_new` * Run rustfmt
This commit is contained in:
@@ -120,7 +120,7 @@ pub fn instantiate(
|
||||
}
|
||||
}
|
||||
|
||||
let instance = wasmtime::Instance::new(&store, &module, &imports)
|
||||
let instance = wasmtime::Instance::new(&module, &imports)
|
||||
.map_err(|t| PyErr::new::<Exception, _>(format!("instantiated with trap {:?}", t)))?;
|
||||
|
||||
let module = Py::new(py, Module { module })?;
|
||||
|
||||
@@ -75,7 +75,7 @@ fn generate_load(item: &syn::ItemTrait) -> syn::Result<TokenStream> {
|
||||
}
|
||||
}
|
||||
let instance =
|
||||
Instance::new(&store, &module, &imports).map_err(|t| format_err!("instantiation trap: {:?}", t))?;
|
||||
Instance::new(&module, &imports).map_err(|t| format_err!("instantiation trap: {:?}", t))?;
|
||||
|
||||
Ok(#name { instance, data })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user