Update with PR review suggestions

This commit is contained in:
Brandon Fish
2019-11-10 14:37:36 -06:00
parent 1f9316b5ae
commit 2d00b2589e
2 changed files with 7 additions and 1 deletions

View File

@ -6,16 +6,22 @@ use std::any::Any;
/// Aliases the standard `Result` type as `Result` within this module.
pub type Result<T> = std::result::Result<T, Error>;
/// Result of an attempt to compile the provided WebAssembly module into a `Module`.
/// Aliases the standard `Result` with `CompileError` as the default error type.
pub type CompileResult<T> = std::result::Result<T, CompileError>;
/// Result of an attempt to link the provided WebAssembly instance.
/// Aliases the standard `Result` with `Vec<LinkError>` as the default error type.
pub type LinkResult<T> = std::result::Result<T, Vec<LinkError>>;
/// Result of an attempt to run the provided WebAssembly instance.
/// Aliases the standard `Result` with `RuntimeError` as the default error type.
pub type RuntimeResult<T> = std::result::Result<T, RuntimeError>;
/// Result of an attempt to call the provided WebAssembly instance.
/// Aliases the standard `Result` with `CallError` as the default error type.
pub type CallResult<T> = std::result::Result<T, CallError>;
/// Result of an attempt to resolve a WebAssembly function by name.
/// Aliases the standard `Result` with `ResolveError` as the default error type.
pub type ResolveResult<T> = std::result::Result<T, ResolveError>;
/// Result of an attempt to parse bytes into a WebAssembly module.
/// Aliases the standard `Result` with `ParseError` as the default error type.
pub type ParseResult<T> = std::result::Result<T, ParseError>;

View File

@ -577,7 +577,7 @@ pub struct LocalTable {
unsafe impl Send for LocalTable {}
impl LocalTable {
/// Offset base.
/// Offset to base.
#[allow(clippy::erasing_op)] // TODO
pub fn offset_base() -> u8 {
0 * (mem::size_of::<usize>() as u8)