Fix linter

This commit is contained in:
ptitSeb
2022-08-18 16:58:04 +02:00
parent c7c1507b8b
commit f599df0240
17 changed files with 82 additions and 82 deletions

View File

@@ -101,7 +101,11 @@ impl Memory {
}
/// Creates a new host `Memory` from provided JavaScript memory.
pub fn new_raw(store: &mut impl AsStoreMut, js_memory: js_sys::WebAssembly::Memory, ty: MemoryType) -> Result<Self, MemoryError> {
pub fn new_raw(
store: &mut impl AsStoreMut,
js_memory: js_sys::WebAssembly::Memory,
ty: MemoryType,
) -> Result<Self, MemoryError> {
let vm_memory = VMMemory::new(js_memory, ty);
Ok(Self::from_vm_export(store, vm_memory))
}

View File

@@ -182,27 +182,23 @@ impl Imports {
}
pub struct ImportsIterator<'a> {
iter: std::collections::hash_map::Iter<'a, (String, String), Extern>
iter: std::collections::hash_map::Iter<'a, (String, String), Extern>,
}
impl<'a> ImportsIterator<'a>
{
impl<'a> ImportsIterator<'a> {
fn new(imports: &'a Imports) -> Self {
let iter = imports.map.iter();
Self { iter }
}
}
impl<'a> Iterator
for ImportsIterator<'a> {
impl<'a> Iterator for ImportsIterator<'a> {
type Item = (&'a str, &'a str, &'a Extern);
fn next(&mut self) -> Option<Self::Item> {
self.iter
.next()
.map(|(k, v)| {
(k.0.as_str(), k.1.as_str(), v)
})
.map(|(k, v)| (k.0.as_str(), k.1.as_str(), v))
}
}

View File

@@ -75,7 +75,7 @@ pub use crate::js::value::Value as Val;
pub mod vm {
//! The `vm` module re-exports wasmer-vm types.
pub use crate::js::export::VMMemory;
}