Improved syntax

This commit is contained in:
Syrus
2019-12-20 22:01:18 -08:00
parent f3b9ecbaea
commit 71be5bea16
4 changed files with 5 additions and 18 deletions

View File

@ -7,10 +7,7 @@ mod tests {
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_runtime_core::fault::{pop_code_version, push_code_version}; use wasmer_runtime_core::fault::{pop_code_version, push_code_version};
use wasmer_runtime_core::state::CodeVersion; use wasmer_runtime_core::state::CodeVersion;
use wasmer_runtime_core::{ use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func};
backend::Compiler,
compile_with, imports, Func,
};
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
fn get_compiler(limit: u64) -> impl Compiler { fn get_compiler(limit: u64) -> impl Compiler {

View File

@ -2,10 +2,7 @@
//! serializing compiled wasm code to a binary format. The binary format can be persisted, //! serializing compiled wasm code to a binary format. The binary format can be persisted,
//! and loaded to allow skipping compilation and fast startup. //! and loaded to allow skipping compilation and fast startup.
use crate::{ use crate::{module::ModuleInfo, sys::Memory};
module::ModuleInfo,
sys::Memory,
};
use blake2b_simd::blake2bp; use blake2b_simd::blake2bp;
use std::{io, mem, slice}; use std::{io, mem, slice};

View File

@ -240,12 +240,7 @@ impl<
_ => MCG::new(), _ => MCG::new(),
}; };
let mut chain = (self.middleware_chain_generator)(); let mut chain = (self.middleware_chain_generator)();
let info = crate::parse::read_module( let info = crate::parse::read_module(wasm, &mut mcg, &mut chain, &compiler_config)?;
wasm,
&mut mcg,
&mut chain,
&compiler_config,
)?;
let (exec_context, cache_gen) = let (exec_context, cache_gen) =
mcg.finalize(&info.read().unwrap()) mcg.finalize(&info.read().unwrap())
.map_err(|x| CompileError::InternalError { .map_err(|x| CompileError::InternalError {

View File

@ -11,11 +11,9 @@ use std::{
path::PathBuf, path::PathBuf,
}; };
use wasmer_runtime_core::cache::Error as CacheError;
pub use wasmer_runtime_core::{
cache::{Artifact, WasmHash},
};
pub use super::Backend; pub use super::Backend;
use wasmer_runtime_core::cache::Error as CacheError;
pub use wasmer_runtime_core::cache::{Artifact, WasmHash};
/// A generic cache for storing and loading compiled wasm modules. /// A generic cache for storing and loading compiled wasm modules.
/// ///