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.
winit 0.29
1 parent 7358fae commit 72c79f3Copy full SHA for 72c79f3
examples/runners/wgpu/src/graphics.rs
@@ -497,10 +497,11 @@ pub fn start(
497
use winit::platform::web::WindowExtWebSys;
498
// On wasm, append the canvas to the document body
499
web_sys::window()
500
- .and_then(|win| win.document())
501
- .and_then(|doc| doc.body())
502
- .and_then(|body| {
503
- body.append_child(&web_sys::Element::from(window.canvas()))
+ .and_then(|dom_window| {
+ dom_window
+ .document()?
+ .body()?
504
+ .append_child(&web_sys::Element::from(window.canvas()?))
505
.ok()
506
})
507
.expect("couldn't append canvas to document body");
0 commit comments