Implement Exportable for NativeFunc

This commit is contained in:
Mark McCaskey
2020-06-08 16:07:22 -07:00
parent e2b6041a65
commit 8530e5eb55
9 changed files with 61 additions and 60 deletions

View File

@@ -317,9 +317,9 @@ impl<'a> Exportable<'a> for Function {
fn to_export(&self) -> Export {
self.exported.clone().into()
}
fn get_self_from_extern(_extern: &'a Extern) -> Result<&'a Self, ExportError> {
fn get_self_from_extern(_extern: &'a Extern) -> Result<Self, ExportError> {
match _extern {
Extern::Function(func) => Ok(func),
Extern::Function(func) => Ok(func.clone()),
_ => Err(ExportError::IncompatibleType),
}
}