From 4652d4810548cb48c89964e7b81f8fc59686a4d3 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Sat, 8 Jul 2023 17:05:05 +0200 Subject: [PATCH] Don't unnecessarily clone canvas on Web (#2934) --- src/platform_impl/web/web_sys/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/web/web_sys/mod.rs b/src/platform_impl/web/web_sys/mod.rs index 558bd1a2..92d7fd42 100644 --- a/src/platform_impl/web/web_sys/mod.rs +++ b/src/platform_impl/web/web_sys/mod.rs @@ -121,8 +121,8 @@ pub fn is_fullscreen(window: &web_sys::Window, canvas: &HtmlCanvasElement) -> bo match document.fullscreen_element() { Some(elem) => { - let raw: Element = canvas.clone().into(); - raw == elem + let canvas: &Element = canvas; + canvas == &elem } None => false, }