We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1280e96 commit 1dc6d7aCopy full SHA for 1dc6d7a
examples/vanilla/src/main.rs
@@ -5,10 +5,13 @@ use wasm_bindgen::prelude::*;
5
use web_sys::window;
6
7
fn start_app() {
8
- let document = window().and_then(|win| win.document()).expect("Could not access document");
+ let document = window()
9
+ .and_then(|win| win.document())
10
+ .expect("Could not access document");
11
let body = document.body().expect("Could not access document.body");
12
let text_node = document.create_text_node("Hello, world from Vanilla Rust!");
- body.append_child(text_node.as_ref()).expect("Failed to append text");
13
+ body.append_child(text_node.as_ref())
14
+ .expect("Failed to append text");
15
}
16
17
#[wasm_bindgen(inline_js = "export function snippetTest() { console.log('Hello from JS FFI!'); }")]
0 commit comments