Improved examples

This commit is contained in:
Syrus Akbary
2023-03-16 05:59:47 -07:00
parent 58828dff3d
commit 195d652474
18 changed files with 56 additions and 119 deletions

View File

@ -21,7 +21,6 @@ use wasmer::{
imports, wat2wasm, Function, FunctionEnv, FunctionEnvMut, FunctionType, Instance, Module,
Store, Type, TypedFunction, Value,
};
use wasmer_compiler_cranelift::Cranelift;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Let's declare the Wasm module with the text representation.
@ -41,10 +40,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)?;
// Create a Store.
// Note that we don't need to specify the engine/compiler if we want to use
// the default provided by Wasmer.
// You can use `Store::default()` for that.
let mut store = Store::new(Cranelift::default());
let mut store = Store::default();
struct MyEnv;
let env = FunctionEnv::new(&mut store, MyEnv {});