Improved tests clarity

This commit is contained in:
Syrus Akbary
2021-07-12 23:21:55 -07:00
parent 226f985dc1
commit f46b01c260
3 changed files with 92 additions and 109 deletions

View File

@@ -33,17 +33,12 @@ pub struct VMFunctionBody(u8);
/// with native functions. Attempting to create a native `Function` with one will
/// result in a panic.
/// [Closures as host functions tracking issue](https://github.com/wasmerio/wasmer/issues/1840)
#[derive(Clone, PartialEq)]
pub struct Function {
pub(crate) store: Store,
pub(crate) exported: VMFunction,
}
impl PartialEq for Function {
fn eq(&self, other: &Self) -> bool {
self.exported == other.exported
}
}
impl wasmer_types::WasmValueType for Function {
/// Write the value.
unsafe fn write_value_to(&self, p: *mut i128) {
@@ -761,19 +756,6 @@ impl<'a> Exportable<'a> for Function {
}
}
impl Clone for Function {
fn clone(&self) -> Self {
unimplemented!();
// let mut exported = self.exported.clone();
// exported.vm_function.upgrade_instance_ref().unwrap();
// Self {
// store: self.store.clone(),
// exported,
// }
}
}
impl fmt::Debug for Function {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter

View File

@@ -1,4 +1,3 @@
use std::any::Any;
use std::fmt;
/// The store represents all global state that can be manipulated by