mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 15:22:03 +00:00
Cleanup.
This commit is contained in:
@@ -5,7 +5,6 @@ use crate::types::{
|
|||||||
use core::borrow::Borrow;
|
use core::borrow::Borrow;
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use wasmparser::BinaryReaderError;
|
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
pub type CompileResult<T> = std::result::Result<T, CompileError>;
|
pub type CompileResult<T> = std::result::Result<T, CompileError>;
|
||||||
@@ -25,14 +24,6 @@ pub enum CompileError {
|
|||||||
InternalError { msg: String },
|
InternalError { msg: String },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<BinaryReaderError> for CompileError {
|
|
||||||
fn from(other: BinaryReaderError) -> CompileError {
|
|
||||||
CompileError::InternalError {
|
|
||||||
msg: format!("{:?}", other),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PartialEq for CompileError {
|
impl PartialEq for CompileError {
|
||||||
fn eq(&self, _other: &CompileError) -> bool {
|
fn eq(&self, _other: &CompileError) -> bool {
|
||||||
false
|
false
|
||||||
|
@@ -18,21 +18,6 @@ pub enum Type {
|
|||||||
F64,
|
F64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Type {
|
|
||||||
pub fn from_wasmparser_type(other: ::wasmparser::Type) -> CompileResult<Type> {
|
|
||||||
use wasmparser::Type as WPType;
|
|
||||||
match other {
|
|
||||||
WPType::I32 => Ok(Type::I32),
|
|
||||||
WPType::I64 => Ok(Type::I64),
|
|
||||||
WPType::F32 => Ok(Type::F32),
|
|
||||||
WPType::F64 => Ok(Type::F64),
|
|
||||||
_ => Err(CompileError::ValidationError {
|
|
||||||
msg: "type cannot be converted into a core type".into(),
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for Type {
|
impl std::fmt::Display for Type {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
write!(f, "{:?}", self)
|
write!(f, "{:?}", self)
|
||||||
|
@@ -3,7 +3,7 @@ use crate::{
|
|||||||
memory::Memory,
|
memory::Memory,
|
||||||
module::ModuleInner,
|
module::ModuleInner,
|
||||||
structures::TypedIndex,
|
structures::TypedIndex,
|
||||||
types::{FuncIndex, LocalOrImport, MemoryIndex},
|
types::{LocalOrImport, MemoryIndex},
|
||||||
};
|
};
|
||||||
use std::{ffi::c_void, mem, ptr};
|
use std::{ffi::c_void, mem, ptr};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user