diff options
| author | Henry <mail@henrygressmann.de> | 2026-09-14 11:14:37 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-09-14 11:14:37 +0200 |
| commit | 70b4ca7b8effb5b8f61c7a43ea15a77af0db0103 (patch) | |
| tree | 747c29744b3afa3512c99ce17511dfffdb092506 /examples | |
| parent | 437a77c8d9e9286a7ca7993b6c8b85e7feb6ebdd (diff) | |
chore: update changelog, fix clippy issues
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rust.rs | 14 | ||||
| -rw-r--r-- | examples/rust/Cargo.toml | 4 | ||||
| -rwxr-xr-x | examples/rust/build.sh | 4 | ||||
| -rw-r--r-- | examples/rust/src/print.twasm | bin | 155 -> 155 bytes |
4 files changed, 11 insertions, 11 deletions
diff --git a/examples/rust.rs b/examples/rust.rs index 24b3b73..77ba428 100644 --- a/examples/rust.rs +++ b/examples/rust.rs @@ -32,10 +32,10 @@ fn main() -> Result<()> { println!("Available examples:"); println!(" hello"); println!(" printi32"); - println!(" host_fn"); + println!(" host-fn"); println!(" fibonacci - calculate fibonacci(30)"); println!(" tinywasm - run printi32 inside of tinywasm inside of itself"); - println!(" tinywasm_no_std - run a precompiled module inside of no_std tinywasm"); + println!(" tinywasm-no-std - run a precompiled module inside of no_std tinywasm"); println!(" argon2id - run argon2id(1000, 2, 1)"); return Ok(()); } @@ -45,9 +45,9 @@ fn main() -> Result<()> { "printi32" => printi32()?, "fibonacci" => fibonacci()?, "tinywasm" => tinywasm()?, - "tinywasm_no_std" => tinywasm_no_std()?, + "tinywasm-no-std" => tinywasm_no_std()?, "argon2id" => argon2id()?, - "host_fn" => host_fn()?, + "host-fn" => host_fn()?, "all" => { println!("Running all examples"); println!("\nhello.wasm:"); @@ -58,11 +58,11 @@ fn main() -> Result<()> { fibonacci()?; println!("\ntinywasm.wasm:"); tinywasm()?; - println!("\ntinywasm_no_std.wasm:"); + println!("\ntinywasm-no-std.wasm:"); tinywasm_no_std()?; println!("argon2id.wasm:"); argon2id()?; - println!("\nhost_fn.wasm:"); + println!("\nhost-fn.wasm:"); host_fn()?; } _ => {} @@ -129,7 +129,7 @@ fn hello() -> Result<()> { } fn host_fn() -> Result<()> { - let module = tinywasm::parse_file("./examples/rust/out/host_fn.opt.wasm")?; + let module = tinywasm::parse_file("./examples/rust/out/host-fn.opt.wasm")?; let mut store = Store::default(); let bar = HostFunction::from(|_: FuncContext<'_>, (left, right): (i64, i32)| { diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index e0bdba6..74d38e7 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -11,7 +11,7 @@ name = "hello" path = "src/hello.rs" [[bin]] -name = "host_fn" +name = "host-fn" path = "src/host_fn.rs" [[bin]] @@ -23,7 +23,7 @@ name = "tinywasm" path = "src/tinywasm.rs" [[bin]] -name = "tinywasm_no_std" +name = "tinywasm-no-std" path = "src/tinywasm_no_std.rs" [[bin]] diff --git a/examples/rust/build.sh b/examples/rust/build.sh index 873028f..aa60d33 100755 --- a/examples/rust/build.sh +++ b/examples/rust/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash cd "$(dirname "$0")" || exit -bins=("host_fn" "hello" "fibonacci" "print" "tinywasm" "argon2id") +bins=("host-fn" "hello" "fibonacci" "print" "tinywasm" "argon2id") exclude_wat=("tinywasm") out_dir="./target/wasm32-unknown-unknown/wasm" dest_dir="out" @@ -17,7 +17,7 @@ cargo run --quiet --manifest-path "../../Cargo.toml" --package tinywasm-cli -- \ compile "src/print.wasm" --output "src/print.twasm" --force || exit # build no_std -RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none -C target-feature=$rust_features -C panic=abort" cargo build -Z build-std=core,alloc,panic_abort -Z build-std-features="optimize_for_size" --target wasm32-unknown-unknown --package rust-wasm-examples --profile=wasm --bin tinywasm_no_std --no-default-features +RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none -C target-feature=$rust_features -C panic=abort" cargo build -Z build-std=core,alloc,panic_abort -Z build-std-features="optimize_for_size" --target wasm32-unknown-unknown --package rust-wasm-examples --profile=wasm --bin tinywasm-no-std --no-default-features cp "$out_dir/tinywasm_no_std.wasm" "$dest_dir/" wasm-opt "$dest_dir/tinywasm_no_std.wasm" -o "$dest_dir/tinywasm_no_std.opt.wasm" -O3 $wasmopt_features diff --git a/examples/rust/src/print.twasm b/examples/rust/src/print.twasm Binary files differindex 967eda1..8ad32e3 100644 --- a/examples/rust/src/print.twasm +++ b/examples/rust/src/print.twasm |
