mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 22:28:21 +00:00
Make FuncRef nullable at the API level
This commit is contained in:
@@ -118,7 +118,7 @@ fn main() -> anyhow::Result<()> {
|
||||
);
|
||||
// Now demonstarte that the function we grew the table with is actually in the table.
|
||||
for table_index in 3..6 {
|
||||
if let Value::FuncRef(f) = guest_table.get(table_index as _).unwrap() {
|
||||
if let Value::FuncRef(Some(f)) = guest_table.get(table_index as _).unwrap() {
|
||||
let result = f.call(&[Value::I32(1), Value::I32(9)])?;
|
||||
assert_eq!(result[0], Value::I32(10));
|
||||
} else {
|
||||
@@ -140,7 +140,7 @@ fn main() -> anyhow::Result<()> {
|
||||
// Now demonstrate that the host and guest see the same table and that both
|
||||
// get the same result.
|
||||
for table_index in 3..6 {
|
||||
if let Value::FuncRef(f) = guest_table.get(table_index as _).unwrap() {
|
||||
if let Value::FuncRef(Some(f)) = guest_table.get(table_index as _).unwrap() {
|
||||
let result = f.call(&[Value::I32(1), Value::I32(9)])?;
|
||||
assert_eq!(result[0], Value::I32(10));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user