From 42e88369dc34772ab9b607b1bbefcf7eda533224 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 29 Jul 2024 23:14:04 +0200 Subject: [PATCH] fix: coding style --- comfy/src/game_loop.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/comfy/src/game_loop.rs b/comfy/src/game_loop.rs index 4f8913a..f20c7a4 100644 --- a/comfy/src/game_loop.rs +++ b/comfy/src/game_loop.rs @@ -101,17 +101,15 @@ pub async fn run_comfy_main_async( web_sys::window() .and_then(|win| win.document()) .and_then(|doc| { + let canvas = web_sys::Element::from(window.canvas().unwrap()); + match &game_config().wasm_append_id { Some(id) => { let dst = doc.get_element_by_id(&id)?; - let canvas = - web_sys::Element::from(window.canvas().unwrap()); dst.append_child(&canvas).ok()?; } _ => { let dst = doc.body()?; - let canvas = web_sys:: - Element::from(window.canvas().unwrap()); dst.append_child(&canvas).ok()?; } };