This commit is contained in:
Mackenzie Clark 2019-03-28 11:42:59 -07:00
parent 5294eb6b0d
commit c684ea46f0
3 changed files with 8 additions and 7 deletions

View File

@ -48,7 +48,6 @@ impl FileLike for Stdout {
fn set_file_len(&mut self, _len: usize) -> Result<(), failure::Error> {
panic!("Cannot set length of stdout");
}
}

View File

@ -2,7 +2,7 @@ use failure::Error;
use crate::vfs::file_like::{FileLike, Metadata};
use std::io;
use std::io::{Seek, SeekFrom, Write, Read};
use std::io::{Read, Seek, SeekFrom, Write};
impl FileLike for zbox::File {
fn metadata(&self) -> Result<Metadata, Error> {

View File

@ -67,11 +67,13 @@ pub fn compile_with(
compiler: &dyn backend::Compiler,
) -> CompileResult<module::Module> {
let token = backend::Token::generate();
compiler.compile(wasm, Default::default(), token).map(|mut inner| {
let inner_info: &mut crate::module::ModuleInfo = &mut inner.info;
inner_info.import_custom_sections(wasm).unwrap();
module::Module::new(Arc::new(inner))
})
compiler
.compile(wasm, Default::default(), token)
.map(|mut inner| {
let inner_info: &mut crate::module::ModuleInfo = &mut inner.info;
inner_info.import_custom_sections(wasm).unwrap();
module::Module::new(Arc::new(inner))
})
}
/// The same as `compile_with` but changes the compiler behavior