Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbb1e0b

Browse files
ci: exclude wasm-rust example
Signed-off-by: Henry Gressmann <[email protected]>
1 parent d8d439e commit bbb1e0b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

crates/tinywasm/src/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl ModuleInstance {
199199
pub fn memory(&self, store: &Store, addr: MemAddr) -> Result<MemoryRef> {
200200
let addr = self.resolve_mem_addr(addr);
201201
let mem = store.get_mem(addr as usize)?;
202-
Ok(MemoryRef { instance: mem.clone() })
202+
Ok(MemoryRef { _instance: mem.clone() })
203203
}
204204

205205
/// Get the start function of the module

crates/tinywasm/src/reference.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
use core::cell::RefCell;
22

3-
use alloc::rc::Rc;
4-
53
use crate::{GlobalInstance, MemoryInstance};
4+
use alloc::rc::Rc;
5+
// This module essentially contains the public APIs to interact with the data stored in the store
66

77
/// A reference to a memory instance
88
#[derive(Debug, Clone)]
99
pub struct MemoryRef {
10-
pub(crate) instance: Rc<RefCell<MemoryInstance>>,
10+
pub(crate) _instance: Rc<RefCell<MemoryInstance>>,
1111
}
1212

1313
/// A reference to a global instance
1414
#[derive(Debug, Clone)]
1515
pub struct GlobalRef {
16-
pub(crate) instance: Rc<RefCell<GlobalInstance>>,
16+
pub(crate) _instance: Rc<RefCell<GlobalInstance>>,
1717
}

examples/wasm-rust.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use color_eyre::eyre::Result;
22
use tinywasm::{Extern, FuncContext, Imports, Module, Store};
33

4+
#[cfg(not(test))]
45
fn main() -> Result<()> {
56
let args = std::env::args().collect::<Vec<_>>();
67
if args.len() < 2 {
@@ -21,6 +22,7 @@ fn main() -> Result<()> {
2122
Ok(())
2223
}
2324

25+
#[cfg(not(test))]
2426
fn tinywasm() -> Result<()> {
2527
const TINYWASM: &[u8] = include_bytes!("./rust/out/tinywasm.wasm");
2628
let module = Module::parse_bytes(&TINYWASM)?;
@@ -43,6 +45,7 @@ fn tinywasm() -> Result<()> {
4345
Ok(())
4446
}
4547

48+
#[cfg(not(test))]
4649
fn hello() -> Result<()> {
4750
const HELLO_WASM: &[u8] = include_bytes!("./rust/out/hello.wasm");
4851
let module = Module::parse_bytes(&HELLO_WASM)?;
@@ -65,6 +68,7 @@ fn hello() -> Result<()> {
6568
Ok(())
6669
}
6770

71+
#[cfg(not(test))]
6872
fn fibonacci() -> Result<()> {
6973
const FIBONACCI_WASM: &[u8] = include_bytes!("./rust/out/fibonacci.wasm");
7074
let module = Module::parse_bytes(&FIBONACCI_WASM)?;

0 commit comments

Comments
 (0)