mirror of
https://github.com/mii443/wasmer.git
synced 2025-09-01 15:09:17 +00:00
Improved examples
This commit is contained in:
@ -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 {});
|
||||
|
||||
|
Reference in New Issue
Block a user