Add an example of a minimal wasm module

This commit is contained in:
Alex Crichton
2018-04-20 22:38:22 -07:00
parent 4100dc9c53
commit 947386ee57
11 changed files with 131 additions and 0 deletions

10
examples/add/src/lib.rs Normal file
View File

@ -0,0 +1,10 @@
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn add(a: u32, b: u32) -> u32 {
a + b
}