Skip to content

Commit fd91517

Browse files
Fix clippy warnings
1 parent 8a3f00f commit fd91517

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

wgpu/tests/common/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ fn initialize_adapter() -> Adapter {
363363

364364
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
365365
fn create_html_canvas() -> HtmlCanvasElement {
366-
return web_sys::window()
366+
web_sys::window()
367367
.and_then(|win| win.document())
368368
.and_then(|doc| {
369369
let body = doc.body().unwrap();
@@ -372,19 +372,16 @@ fn create_html_canvas() -> HtmlCanvasElement {
372372
body.append_child(&canvas).unwrap();
373373
canvas.dyn_into::<web_sys::HtmlCanvasElement>().ok()
374374
})
375-
.expect("couldn't append canvas to document body");
375+
.expect("couldn't append canvas to document body")
376376
}
377377

378378
#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
379379
fn delete_html_canvas() {
380-
web_sys::window()
381-
.and_then(|win| win.document())
382-
.and_then(|document| {
383-
if let Some(element) = document.get_element_by_id(CANVAS_ID) {
384-
element.remove();
385-
}
386-
Some(())
387-
});
380+
if let Some(document) = web_sys::window().and_then(|win| win.document()) {
381+
if let Some(element) = document.get_element_by_id(CANVAS_ID) {
382+
element.remove();
383+
}
384+
};
388385
}
389386

390387
// Run some code in an error scope and assert that validation fails.

0 commit comments

Comments
 (0)