From e4c37fd6037ea8f26c68d5f09883f38cec6b95ab Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Tue, 9 Jan 2018 13:08:19 -0500 Subject: [PATCH 1/2] Simplified docs for interpreter::native_module() a little --- src/interpreter/native.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/interpreter/native.rs b/src/interpreter/native.rs index 29fa045..09cfc6d 100644 --- a/src/interpreter/native.rs +++ b/src/interpreter/native.rs @@ -253,11 +253,7 @@ impl ModuleInstanceInterface for NativeModuleInstance ModuleInstanceInterface for NativeModuleInstance { /// // fn add(a: u32, b: u32) -> u32 -/// let b = context.value_stack.pop_as::()? as u32; -/// let a = context.value_stack.pop_as::()? as u32; +/// let b = context.value_stack.pop_as::()?; +/// let a = context.value_stack.pop_as::()?; /// let sum = a + b; /// Ok(Some(RuntimeValue::I32(sum as i32))) /// } From 5c42a7af1f01196c74ae6329253360bfe5b6acdf Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Tue, 9 Jan 2018 13:38:09 -0500 Subject: [PATCH 2/2] Trivial fix to README example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f73a37..ed8cc80 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ along with experimental interpreter extern crate parity_wasm; -let module = parity_wasm::deserialize_file("./res/cases/v1/hello.wasm"); -assert_eq!(module.code_section().is_some()); +let module = parity_wasm::deserialize_file("./res/cases/v1/hello.wasm").unwrap(); +assert!(module.code_section().is_some()); let code_section = module.code_section().unwrap(); // Part of the module with functions code