mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 20:31:29 +11:00
Clean up casting
Get rid of unneeded clone and make syntax nicer.
This commit is contained in:
parent
e7c7f10524
commit
1b3938e54f
|
@ -516,10 +516,7 @@ pub fn main() -> Result<()> {
|
||||||
web_sys::window()
|
web_sys::window()
|
||||||
.and_then(|win| win.document())
|
.and_then(|win| win.document())
|
||||||
.and_then(|doc| doc.body())
|
.and_then(|doc| doc.body())
|
||||||
.and_then(|body| {
|
.and_then(|body| body.append_child(canvas.as_ref()).ok())
|
||||||
body.append_child(&web_sys::Element::from(canvas.clone()))
|
|
||||||
.ok()
|
|
||||||
})
|
|
||||||
.expect("couldn't append canvas to document body");
|
.expect("couldn't append canvas to document body");
|
||||||
_ = web_sys::HtmlElement::from(canvas).focus();
|
_ = web_sys::HtmlElement::from(canvas).focus();
|
||||||
wasm_bindgen_futures::spawn_local(async move {
|
wasm_bindgen_futures::spawn_local(async move {
|
||||||
|
|
Loading…
Reference in a new issue