Closed
Description
Take the definition of append_child
for example.
pub fn append_child(&self, node: &Node) -> Result<Node, JsValue>
I find myself having to manually coerce an Element
into the correct type, for example:
let document = web_sys::window().unwrap().document().unwrap();
let val = document.create_element("p").unwrap();
val.set_inner_html("Hello from Rust, WebAssembly, WebPack, and web-sys!");
AsRef::<Node>::as_ref(&document.body().unwrap()).append_child(AsRef::<Node>::as_ref(&val));
Metadata
Metadata
Assignees
Labels
No labels