cargo fmt && fix issue with function_body_ptr

This commit is contained in:
Felix Schütt
2022-08-26 18:48:48 +02:00
parent 14ddcfd153
commit 2ee66140c9
4 changed files with 10 additions and 12 deletions

View File

@@ -908,7 +908,7 @@ mod inner {
Kind: HostFunctionKind,
{
/// Get the pointer to the function body.
fn function_body_ptr(self) -> *const VMFunctionBody;
fn function_body_ptr(&self) -> *const VMFunctionBody;
// /// Get the pointer to the function call trampoline.
// fn call_trampoline_address() -> VMTrampoline;
@@ -1122,7 +1122,7 @@ mod inner {
Func: Fn(FunctionEnvMut<'_, T>, $( $x , )*) -> RetsAsResult + 'static,
{
#[allow(non_snake_case)]
fn function_body_ptr(self) -> *const VMFunctionBody {
fn function_body_ptr(&self) -> *const VMFunctionBody {
/// This is a function that wraps the real host
/// function. Its address will be used inside the
/// runtime.
@@ -1170,7 +1170,7 @@ mod inner {
Func: Fn($( $x , )*) -> RetsAsResult + 'static,
{
#[allow(non_snake_case)]
fn function_body_ptr(self) -> *const VMFunctionBody {
fn function_body_ptr(&self) -> *const VMFunctionBody {
/// This is a function that wraps the real host
/// function. Its address will be used inside the
/// runtime.

View File

@@ -118,10 +118,8 @@ impl Instance {
.map(|export_type| {
let name = export_type.name();
let extern_type = export_type.ty().clone();
let js_export =
js_sys::Reflect::get(&instance_exports, &name.into()).map_err(|_e| {
InstantiationError::NotInExports(name.to_string())
})?;
let js_export = js_sys::Reflect::get(&instance_exports, &name.into())
.map_err(|_e| InstantiationError::NotInExports(name.to_string()))?;
let export: Export =
Export::from_js_value(js_export, &mut store, extern_type)?.into();
let extern_ = Extern::from_vm_extern(&mut store, export);

View File

@@ -560,11 +560,11 @@ impl Module {
/// is returned.
pub fn custom_sections<'a>(&'a self, name: &'a str) -> impl Iterator<Item = Box<[u8]>> + 'a {
// TODO: implement on JavaScript
DefaultCustomSectionsIterator { }
DefaultCustomSectionsIterator {}
}
}
pub struct DefaultCustomSectionsIterator { }
pub struct DefaultCustomSectionsIterator {}
impl Iterator for DefaultCustomSectionsIterator {
type Item = Box<[u8]>;

View File

@@ -1092,7 +1092,7 @@ mod inner {
Kind: HostFunctionKind,
{
/// Get the pointer to the function body.
fn function_body_ptr(self) -> *const VMFunctionBody;
fn function_body_ptr(&self) -> *const VMFunctionBody;
/// Get the pointer to the function call trampoline.
fn call_trampoline_address() -> VMTrampoline;
@@ -1268,7 +1268,7 @@ mod inner {
Func: Fn(FunctionEnvMut<T>, $( $x , )*) -> RetsAsResult + 'static,
{
#[allow(non_snake_case)]
fn function_body_ptr(self) -> *const VMFunctionBody {
fn function_body_ptr(&self) -> *const VMFunctionBody {
/// This is a function that wraps the real host
/// function. Its address will be used inside the
/// runtime.
@@ -1352,7 +1352,7 @@ mod inner {
Func: Fn($( $x , )*) -> RetsAsResult + 'static,
{
#[allow(non_snake_case)]
fn function_body_ptr(self) -> *const VMFunctionBody {
fn function_body_ptr(&self) -> *const VMFunctionBody {
/// This is a function that wraps the real host
/// function. Its address will be used inside the
/// runtime.