From 3518959fd4d081f5e672ced263b66ce67f949ba3 Mon Sep 17 00:00:00 2001 From: Able Date: Sat, 27 Nov 2021 20:14:40 -0600 Subject: [PATCH] fixed doc comments --- src/main.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6922629..5afe214 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,12 +25,12 @@ impl Externals for HostFunctions { args: RuntimeArgs, ) -> Result, Trap> { match index.into() { - /// Take in one arg discard the rest + // Take in one arg discard the rest SysCall::KILL => { - println!("hewwo"); + println!("Program killed"); Ok(None) } - /// Do nothing + // Do nothing SysCall::EMPTY => Ok(None), SysCall::EXIT => Ok(None), SysCall::CONSOLE_RESET => Ok(None), @@ -71,8 +71,9 @@ impl ModuleImportResolver for HostFunctions { } fn main() { - let wasm_binary = include_bytes!("../wasm/rust.wasm"); - // include_bytes!("../wasm/zig.wasm"); + let wasm_binary = // Spacer + // include_bytes!("../wasm/rust.wasm"); + include_bytes!("../wasm/zig.wasm"); // include_bytes!("../wasm/c.wasm"); // include_bytes!("../wasm/wasm.wasm"); @@ -89,13 +90,13 @@ fn main() { // Finally, invoke the exported function "test" with no parameters // and empty external function executor. - let result = instance + let result: i32 = instance .invoke_export("_start", &[], &mut HostFunctions) // .with_resolver(&mut HostFunctions) - .expect("failed to execute export"); - /*.unwrap() - .try_into() - .unwrap();*/ + .expect("failed to execute export") + .unwrap() + .try_into() + .unwrap(); println!( "{:?}",