1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use wasm_bindgen; use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { fn alert(s: &str); #[wasm_bindgen(js_namespace = console)] fn log(s: &str); } #[allow(unused_unsafe)] pub fn console_write(text: &str) { unsafe { log(text) } }