From b9714e1ce17e4f61e34e63628c4021b8f141979d Mon Sep 17 00:00:00 2001 From: losfair Date: Wed, 28 Nov 2018 13:18:23 +0800 Subject: [PATCH] Fix a few warnings --- src/recovery.rs | 3 --- src/webassembly/instance.rs | 11 ++--------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/recovery.rs b/src/recovery.rs index 2a853b6f8..4b296cc9e 100644 --- a/src/recovery.rs +++ b/src/recovery.rs @@ -4,9 +4,6 @@ //! are very special, the async signal unsafety of Rust's TLS implementation generally does not affect the correctness here //! unless you have memory unsafety elsewhere in your code. -use super::sighandler::install_sighandler; -use super::webassembly::ErrorKind; -use nix::sys::signal::{Signal, SIGBUS, SIGFPE, SIGILL, SIGSEGV}; use std::cell::UnsafeCell; extern "C" { diff --git a/src/webassembly/instance.rs b/src/webassembly/instance.rs index 63b1d8b91..ec53ab7eb 100644 --- a/src/webassembly/instance.rs +++ b/src/webassembly/instance.rs @@ -22,7 +22,6 @@ use std::slice; use std::sync::Arc; use super::super::common::slice::{BoundedSlice, UncheckedSlice}; -use super::super::recovery; use super::errors::ErrorKind; use super::import_object::{ImportObject, ImportValue}; use super::math_intrinsics; @@ -481,12 +480,7 @@ impl Instance { tables.iter().map(|table| table[..].into()).collect(); let memories_pointer: Vec> = memories .iter() - .map(|mem| { - BoundedSlice::new( - &mem[..], - mem.current_size(), - ) - }) + .map(|mem| BoundedSlice::new(&mem[..], mem.current_size())) .collect(); let globals_pointer: GlobalsSlice = globals[..].into(); @@ -530,8 +524,7 @@ impl Instance { if let Some(func_index) = self.start_func { let func: fn(&Instance) = get_instance_function!(&self, func_index); call_protected!(func(self)) - } - else { + } else { Ok(()) } }