mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 21:38:39 +00:00
Trying to fix lint issues
This commit is contained in:
@@ -155,7 +155,6 @@ impl From<(JsValue, ExternType)> for Export {
|
||||
panic!("Extern type doesn't match js value type");
|
||||
}
|
||||
}
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
lib/js-api/src/externals/function.rs
vendored
4
lib/js-api/src/externals/function.rs
vendored
@@ -180,7 +180,7 @@ impl Function {
|
||||
.enumerate()
|
||||
.map(|(i, param)| param_from_js(param, &args.get(i as u32)))
|
||||
.collect::<Vec<_>>();
|
||||
let results = func(&wasm_arguments)?;
|
||||
let _results = func(&wasm_arguments)?;
|
||||
Ok(())
|
||||
})
|
||||
as Box<dyn FnMut(&Array) -> Result<(), JsValue>>)
|
||||
@@ -209,7 +209,6 @@ impl Function {
|
||||
})
|
||||
as Box<dyn FnMut(&Array) -> Result<Array, JsValue>>)
|
||||
.into_js_value(),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
|
||||
let dyn_func =
|
||||
@@ -322,7 +321,6 @@ impl Function {
|
||||
})
|
||||
as Box<dyn FnMut(&Array) -> Result<Array, JsValue>>)
|
||||
.into_js_value(),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
|
||||
let dyn_func =
|
||||
|
||||
34
lib/js-api/src/externals/memory.rs
vendored
34
lib/js-api/src/externals/memory.rs
vendored
@@ -140,8 +140,7 @@ impl Memory {
|
||||
/// modify the memory contents in any way including by calling a wasm
|
||||
/// function that writes to the memory or by resizing the memory.
|
||||
pub unsafe fn data_unchecked(&self) -> &[u8] {
|
||||
unimplemented!();
|
||||
// self.data_unchecked_mut()
|
||||
unimplemented!("direct data pointer access is not possible in js");
|
||||
}
|
||||
|
||||
/// Retrieve a mutable slice of the memory contents.
|
||||
@@ -155,18 +154,12 @@ impl Memory {
|
||||
/// by resizing this Memory.
|
||||
#[allow(clippy::mut_from_ref)]
|
||||
pub unsafe fn data_unchecked_mut(&self) -> &mut [u8] {
|
||||
unimplemented!();
|
||||
// let definition = self.vm_memory.from.vmmemory();
|
||||
// let def = definition.as_ref();
|
||||
// slice::from_raw_parts_mut(def.base, def.current_length.try_into().unwrap())
|
||||
unimplemented!("direct data pointer access is not possible in js");
|
||||
}
|
||||
|
||||
/// Returns the pointer to the raw bytes of the `Memory`.
|
||||
pub fn data_ptr(&self) -> *mut u8 {
|
||||
unimplemented!();
|
||||
// let definition = self.vm_memory.from.vmmemory();
|
||||
// let def = unsafe { definition.as_ref() };
|
||||
// def.base
|
||||
unimplemented!("direct data pointer access is not possible in js");
|
||||
}
|
||||
|
||||
/// Returns the size (in bytes) of the `Memory`.
|
||||
@@ -176,8 +169,6 @@ impl Memory {
|
||||
.as_f64()
|
||||
.unwrap() as u64;
|
||||
return bytes;
|
||||
// let def = unsafe { definition.as_ref() };
|
||||
// def.current_length.into()
|
||||
}
|
||||
|
||||
/// Returns the size (in [`Pages`]) of the `Memory`.
|
||||
@@ -198,7 +189,6 @@ impl Memory {
|
||||
.as_f64()
|
||||
.unwrap() as u64;
|
||||
Bytes(bytes as usize).try_into().unwrap()
|
||||
// self.vm_memory.from.size()
|
||||
}
|
||||
|
||||
/// Grow memory by the specified amount of WebAssembly [`Pages`] and return
|
||||
@@ -283,11 +273,6 @@ impl Memory {
|
||||
/// ```
|
||||
pub fn view<T: ValueType>(&self) -> MemoryView<T> {
|
||||
unimplemented!();
|
||||
// let base = self.data_ptr();
|
||||
|
||||
// let length = self.size().bytes().0 / std::mem::size_of::<T>();
|
||||
|
||||
// unsafe { MemoryView::new(base as _, length as u32) }
|
||||
}
|
||||
|
||||
/// example view
|
||||
@@ -319,19 +304,6 @@ impl Memory {
|
||||
}
|
||||
}
|
||||
|
||||
// impl Clone for Memory {
|
||||
// fn clone(&self) -> Self {
|
||||
// unimplemented!();
|
||||
// // let mut vm_memory = self.vm_memory.clone();
|
||||
// // vm_memory.upgrade_instance_ref().unwrap();
|
||||
|
||||
// // Self {
|
||||
// // store: self.store.clone(),
|
||||
// // vm_memory,
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
|
||||
impl<'a> Exportable<'a> for Memory {
|
||||
fn to_export(&self) -> Export {
|
||||
Export::Memory(self.vm_memory.clone())
|
||||
|
||||
@@ -133,7 +133,7 @@ impl Module {
|
||||
}
|
||||
|
||||
/// Creates a new WebAssembly module from a file path.
|
||||
pub fn from_file(store: &Store, _file: impl AsRef<Path>) -> Result<Self, IoCompileError> {
|
||||
pub fn from_file(_store: &Store, _file: impl AsRef<Path>) -> Result<Self, IoCompileError> {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ impl Module {
|
||||
/// This validation is normally pretty fast and checks the enabled
|
||||
/// WebAssembly features in the Store Engine to assure deterministic
|
||||
/// validation of the Module.
|
||||
pub fn validate(store: &Store, binary: &[u8]) -> Result<(), CompileError> {
|
||||
pub fn validate(_store: &Store, binary: &[u8]) -> Result<(), CompileError> {
|
||||
let js_bytes = unsafe { Uint8Array::view(binary) };
|
||||
match WebAssembly::validate(&js_bytes.into()) {
|
||||
Ok(true) => Ok(()),
|
||||
|
||||
Reference in New Issue
Block a user