mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Cleanup.
This commit is contained in:
parent
61abe70042
commit
a006a368c5
@ -5,7 +5,6 @@ use crate::types::{
|
||||
use core::borrow::Borrow;
|
||||
use std::any::Any;
|
||||
use std::sync::Arc;
|
||||
use wasmparser::BinaryReaderError;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
pub type CompileResult<T> = std::result::Result<T, CompileError>;
|
||||
@ -25,14 +24,6 @@ pub enum CompileError {
|
||||
InternalError { msg: String },
|
||||
}
|
||||
|
||||
impl From<BinaryReaderError> for CompileError {
|
||||
fn from(other: BinaryReaderError) -> CompileError {
|
||||
CompileError::InternalError {
|
||||
msg: format!("{:?}", other),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for CompileError {
|
||||
fn eq(&self, _other: &CompileError) -> bool {
|
||||
false
|
||||
|
@ -18,21 +18,6 @@ pub enum Type {
|
||||
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 {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
|
@ -3,7 +3,7 @@ use crate::{
|
||||
memory::Memory,
|
||||
module::ModuleInner,
|
||||
structures::TypedIndex,
|
||||
types::{FuncIndex, LocalOrImport, MemoryIndex},
|
||||
types::{LocalOrImport, MemoryIndex},
|
||||
};
|
||||
use std::{ffi::c_void, mem, ptr};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user