fixed doc comments

This commit is contained in:
Able 2021-11-27 20:14:40 -06:00
parent f22b55e2b6
commit 7915ee7b11

View file

@ -25,12 +25,12 @@ impl Externals for HostFunctions {
args: RuntimeArgs,
) -> Result<Option<RuntimeValue>, 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!(
"{:?}",