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:
@@ -48,8 +48,7 @@ fn main() -> Result<()> {
|
||||
// Note that this is where the wasm `start` function, if any, would run.
|
||||
println!("Instantiating module...");
|
||||
let imports = vec![hello_func.into()];
|
||||
let instance =
|
||||
Instance::new(&store, &module, &imports).context("> Error instantiating module!")?;
|
||||
let instance = Instance::new(&module, &imports).context("> Error instantiating module!")?;
|
||||
|
||||
// Next we poke around a bit to extract the `run` function from the module.
|
||||
println!("Extracting export...");
|
||||
|
||||
Reference in New Issue
Block a user