mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 15:34:09 +01:00
22 lines
432 B
Rust
22 lines
432 B
Rust
use wasm_bindgen::prelude::*;
|
|
|
|
mod utils;
|
|
|
|
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global allocator.
|
|
#[cfg(feature = "wee_alloc")]
|
|
#[global_allocator]
|
|
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
|
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
fn alert(s: &str);
|
|
|
|
#[wasm_bindgen(js_namespace = console)]
|
|
fn log(s: &str);
|
|
}
|
|
|
|
#[wasm_bindgen]
|
|
pub fn greet() {
|
|
log("Hello from Rust WASM!");
|
|
}
|