summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-26 15:21:29 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-26 15:21:29 +0100
commitbbb1e0bd60c624c3273831df376cff8e12977d2c (patch)
tree51fb240370a815ad699537729ce982795b62464e
parentd8d439e6401607fab18feb5025f3b91f135e3a50 (diff)
ci: exclude wasm-rust example
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
-rw-r--r--crates/tinywasm/src/instance.rs2
-rw-r--r--crates/tinywasm/src/reference.rs8
-rw-r--r--examples/wasm-rust.rs4
3 files changed, 9 insertions, 5 deletions
diff --git a/crates/tinywasm/src/instance.rs b/crates/tinywasm/src/instance.rs
index dfee2ca..5346ac3 100644
--- a/crates/tinywasm/src/instance.rs
+++ b/crates/tinywasm/src/instance.rs
@@ -199,7 +199,7 @@ impl ModuleInstance {
pub fn memory(&self, store: &Store, addr: MemAddr) -> Result<MemoryRef> {
let addr = self.resolve_mem_addr(addr);
let mem = store.get_mem(addr as usize)?;
- Ok(MemoryRef { instance: mem.clone() })
+ Ok(MemoryRef { _instance: mem.clone() })
}
/// Get the start function of the module
diff --git a/crates/tinywasm/src/reference.rs b/crates/tinywasm/src/reference.rs
index 21471f6..bc02338 100644
--- a/crates/tinywasm/src/reference.rs
+++ b/crates/tinywasm/src/reference.rs
@@ -1,17 +1,17 @@
use core::cell::RefCell;
-use alloc::rc::Rc;
-
use crate::{GlobalInstance, MemoryInstance};
+use alloc::rc::Rc;
+// This module essentially contains the public APIs to interact with the data stored in the store
/// A reference to a memory instance
#[derive(Debug, Clone)]
pub struct MemoryRef {
- pub(crate) instance: Rc<RefCell<MemoryInstance>>,
+ pub(crate) _instance: Rc<RefCell<MemoryInstance>>,
}
/// A reference to a global instance
#[derive(Debug, Clone)]
pub struct GlobalRef {
- pub(crate) instance: Rc<RefCell<GlobalInstance>>,
+ pub(crate) _instance: Rc<RefCell<GlobalInstance>>,
}
diff --git a/examples/wasm-rust.rs b/examples/wasm-rust.rs
index 3b26863..2c50c4f 100644
--- a/examples/wasm-rust.rs
+++ b/examples/wasm-rust.rs
@@ -1,6 +1,7 @@
use color_eyre::eyre::Result;
use tinywasm::{Extern, FuncContext, Imports, Module, Store};
+#[cfg(not(test))]
fn main() -> Result<()> {
let args = std::env::args().collect::<Vec<_>>();
if args.len() < 2 {
@@ -21,6 +22,7 @@ fn main() -> Result<()> {
Ok(())
}
+#[cfg(not(test))]
fn tinywasm() -> Result<()> {
const TINYWASM: &[u8] = include_bytes!("./rust/out/tinywasm.wasm");
let module = Module::parse_bytes(&TINYWASM)?;
@@ -43,6 +45,7 @@ fn tinywasm() -> Result<()> {
Ok(())
}
+#[cfg(not(test))]
fn hello() -> Result<()> {
const HELLO_WASM: &[u8] = include_bytes!("./rust/out/hello.wasm");
let module = Module::parse_bytes(&HELLO_WASM)?;
@@ -65,6 +68,7 @@ fn hello() -> Result<()> {
Ok(())
}
+#[cfg(not(test))]
fn fibonacci() -> Result<()> {
const FIBONACCI_WASM: &[u8] = include_bytes!("./rust/out/fibonacci.wasm");
let module = Module::parse_bytes(&FIBONACCI_WASM)?;