From 16f51cf1615d65787fcf780be020f511ba8fcafd Mon Sep 17 00:00:00 2001 From: Thomas Schubart <24721048+Furisto@users.noreply.github.com> Date: Sun, 11 Dec 2022 00:23:03 +0100 Subject: [PATCH] Add wasm sample program Signed-off-by: Thomas Schubart <24721048+Furisto@users.noreply.github.com> --- Cargo.toml | 2 +- tools/wasm-sample/Cargo.toml | 8 ++++++++ tools/wasm-sample/src/main.rs | 11 +++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tools/wasm-sample/Cargo.toml create mode 100644 tools/wasm-sample/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 9949d7f4..0fc295d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["tests/rust-integration-tests/*", "crates/*"] +members = ["tests/rust-integration-tests/*", "crates/*", "tools/*"] [profile.release] lto = true diff --git a/tools/wasm-sample/Cargo.toml b/tools/wasm-sample/Cargo.toml new file mode 100644 index 00000000..190638d8 --- /dev/null +++ b/tools/wasm-sample/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "wasm-sample" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/tools/wasm-sample/src/main.rs b/tools/wasm-sample/src/main.rs new file mode 100644 index 00000000..7b5953b7 --- /dev/null +++ b/tools/wasm-sample/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + println!("Printing args"); + for arg in std::env::args().skip(1) { + println!("{}", arg); + } + + println!("Printing envs"); + for envs in std::env::vars() { + println!("{:?}", envs); + } +}