Merge pull request #137 from icefoxen/doc-fixes

Minor doc fixes
This commit is contained in:
Nikolay Volf 2018-01-10 11:26:19 +04:00 committed by GitHub
commit e76f33d6c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -253,11 +253,7 @@ impl<E: UserFunctionExecutor> ModuleInstanceInterface for NativeModuleInstance<E
/// # Examples
///
/// ```rust
/// use parity_wasm::interpreter::{CallerContext, Error, ExecutionParams, ExportEntryType,
/// FunctionSignature, ItemIndex, ModuleInstance,
/// ModuleInstanceInterface, ProgramInstance, RuntimeValue,
/// UserDefinedElements, UserError, UserFunctionDescriptor,
/// UserFunctionExecutor};
/// use parity_wasm::interpreter::{CallerContext, Error, RuntimeValue, UserFunctionExecutor};
///
/// struct MyExecutor;
///
@ -270,8 +266,8 @@ impl<E: UserFunctionExecutor> ModuleInstanceInterface for NativeModuleInstance<E
/// match name {
/// "add" => {
/// // fn add(a: u32, b: u32) -> u32
/// let b = context.value_stack.pop_as::<u32>()? as u32;
/// let a = context.value_stack.pop_as::<u32>()? as u32;
/// let b = context.value_stack.pop_as::<u32>()?;
/// let a = context.value_stack.pop_as::<u32>()?;
/// let sum = a + b;
/// Ok(Some(RuntimeValue::I32(sum as i32)))
/// }