Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldreingruber committed Dec 1, 2022
1 parent 8a3f00f commit 87e1161
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wgpu/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ fn initialize_adapter() -> Adapter {

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
fn create_html_canvas() -> HtmlCanvasElement {
return web_sys::window()
web_sys::window()
.and_then(|win| win.document())
.and_then(|doc| {
let body = doc.body().unwrap();
Expand All @@ -372,18 +372,17 @@ fn create_html_canvas() -> HtmlCanvasElement {
body.append_child(&canvas).unwrap();
canvas.dyn_into::<web_sys::HtmlCanvasElement>().ok()
})
.expect("couldn't append canvas to document body");
.expect("couldn't append canvas to document body")
}

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
fn delete_html_canvas() {
web_sys::window()
.and_then(|win| win.document())
.and_then(|document| {
.map(|document| {
if let Some(element) = document.get_element_by_id(CANVAS_ID) {
element.remove();
}
Some(())
});
}

Expand Down

0 comments on commit 87e1161

Please sign in to comment.