Fixed linting

This commit is contained in:
Syrus Akbary
2021-07-12 22:55:27 -07:00
parent 92755a09e7
commit 115460181a
11 changed files with 14 additions and 47 deletions

View File

@@ -1,12 +1,8 @@
use core::cmp::Ordering;
use core::fmt::{self, Debug, Display};
use core::mem;
use core::ops::{Deref, DerefMut};
use core::ptr;
use core::fmt::{self, Debug};
use std::marker::PhantomData;
use js_sys::Uint8Array;
use wasm_bindgen::JsValue;
/// A mutable Wasm-memory location.
pub struct WasmCell<'a, T: ?Sized> {

View File

@@ -1,9 +1,7 @@
use crate::instance::Instance;
use crate::WasmerEnv;
use core::any::TypeId;
use js_sys::Function;
use js_sys::WebAssembly::Memory;
use std::any::Any;
use std::cell::RefCell;
use std::fmt;
use std::sync::Arc;

View File

@@ -8,7 +8,6 @@ use std::fmt;
use std::iter::{ExactSizeIterator, FromIterator};
use std::sync::Arc;
use thiserror::Error;
use wasm_bindgen::JsValue;
/// The `ExportError` can happen when trying to get a specific
/// export [`Extern`] from the [`Instance`] exports.

View File

@@ -3,24 +3,15 @@ use crate::externals::Extern;
use crate::store::Store;
use crate::types::{AsJs /* ValFuncRef */, Val};
use crate::{FunctionType, ValType};
use core::any::Any;
use wasm_bindgen::prelude::*;
use wasm_bindgen::{JsCast, __rt::WasmRefCell};
use wasm_bindgen::JsCast;
// use crate::NativeFunc;
use crate::RuntimeError;
use crate::WasmerEnv;
pub use inner::{FromToNativeWasmType, HostFunction, WasmTypeList, WithEnv, WithoutEnv};
use crate::export::{Export, VMFunction};
use std::cmp::max;
use std::ffi::c_void;
use std::fmt;
use std::sync::Arc; // ExportFunction, ExportFunctionMetadata
// use wasmer_vm::{
// raise_user_trap, resume_panic, wasmer_call_trampoline, ImportInitializerFuncPtr,
// VMCallerCheckedAnyfunc, VMDynamicFunctionContext, VMFuncRef, VMFunction, VMFunctionBody,
// VMFunctionEnvironment, VMFunctionKind, VMTrampoline,
// };
#[repr(C)]
pub struct VMFunctionBody(u8);
@@ -902,7 +893,7 @@ impl fmt::Debug for Function {
/// This private inner module contains the low-level implementation
/// for `Function` and its siblings.
mod inner {
use super::{JsValue, VMFunctionBody};
use super::VMFunctionBody;
use std::array::TryFromSliceError;
use std::convert::{Infallible, TryInto};
use std::error::Error;

View File

@@ -4,11 +4,8 @@ use crate::externals::Extern;
use crate::store::Store;
use crate::{MemoryType, MemoryView};
use std::convert::TryInto;
use std::slice;
use std::sync::Arc;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasmer_types::{Bytes, Pages, ValueType};
pub type MemoryError = ();

View File

@@ -4,8 +4,8 @@ use crate::externals::Extern;
use crate::module::Module;
use crate::store::Store;
// use crate::{HostEnvInitError, LinkError, RuntimeError};
use crate::resolver::{NamedResolver, Resolver};
use js_sys::{Object, Reflect, WebAssembly};
use crate::resolver::Resolver;
use js_sys::WebAssembly;
use std::fmt;
use thiserror::Error;

View File

@@ -7,19 +7,15 @@ use crate::types::{ExportType, ImportType};
use crate::error::CompileError;
#[cfg(feature = "wat")]
use crate::error::WasmError;
use js_sys::{Function, Object, Reflect, Uint8Array, WebAssembly};
use js_sys::{Reflect, Uint8Array, WebAssembly};
use std::fmt;
use std::io;
use std::path::Path;
use std::sync::Arc;
use thiserror::Error;
use wasmer_types::{
ExternType, FunctionType, GlobalType, MemoryType, Mutability, Pages, TableType, Type,
};
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
#[derive(Error, Debug)]
pub enum IoCompileError {
/// An IO error

View File

@@ -7,25 +7,20 @@
//! https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md
use crate::iterators::{ExportsIterator, ImportsIterator};
use core::convert::TryFrom;
use std::boxed::Box;
use std::collections::HashMap;
use std::vec::Vec;
use wasmer_types::entity::packed_option::ReservedValue;
use wasmer_types::entity::{EntityRef, PrimaryMap};
use wasmer_types::{
DataIndex, ElemIndex, ExportIndex, ExportType, ExternType, FunctionIndex, FunctionType,
GlobalIndex, GlobalInit, GlobalType, ImportIndex, ImportType, MemoryIndex, MemoryType, Pages,
SignatureIndex, TableIndex, TableType, Type, V128,
ExportIndex, ExportType, ExternType, FunctionIndex, FunctionType, GlobalIndex, GlobalType,
ImportIndex, ImportType, MemoryIndex, MemoryType, Pages, SignatureIndex, TableIndex, TableType,
Type,
};
use indexmap::IndexMap;
use wasmparser::{
self, BinaryReaderError, Data, DataKind, DataSectionReader, Element, ElementItem, ElementItems,
ElementKind, ElementSectionReader, Export, ExportSectionReader, ExternalKind,
FuncType as WPFunctionType, FunctionSectionReader, GlobalSectionReader,
GlobalType as WPGlobalType, ImportSectionEntryType, ImportSectionReader, MemorySectionReader,
MemoryType as WPMemoryType, NameSectionReader, Naming, NamingReader, Operator, Parser, Payload,
TableSectionReader, TypeDef, TypeSectionReader,
self, BinaryReaderError, Export, ExportSectionReader, ExternalKind, FuncType as WPFunctionType,
FunctionSectionReader, GlobalSectionReader, GlobalType as WPGlobalType, ImportSectionEntryType,
ImportSectionReader, MemorySectionReader, MemoryType as WPMemoryType, NameSectionReader,
Parser, Payload, TableSectionReader, TypeDef, TypeSectionReader,
};
pub type WasmResult<T> = Result<T, String>;

View File

@@ -8,7 +8,7 @@
use crate::cell::WasmCell;
use crate::{externals::Memory, FromToNativeWasmType};
use std::{cell::Cell, fmt, marker::PhantomData, mem};
use std::{fmt, marker::PhantomData, mem};
use wasmer_types::ValueType;
/// The `Array` marker type. This type can be used like `WasmPtr<T, Array>`

View File

@@ -1,6 +1,4 @@
use crate::export::Export;
use wasmer_types::entity::{BoxedSlice, EntityRef, PrimaryMap};
use wasmer_types::{ExternType, FunctionIndex, ImportIndex, MemoryIndex, TableIndex};
/// Import resolver connects imports with available exported values.
pub trait Resolver {