Skip to content

Commit 764be91

Browse files
authored
bevy_winit: fix compile and clippy on wasm (#19869)
# Objective - bevy_winit has a warning when compiling without default feature on linux - bevy_winit has a clippy warning when compiling in wasm ## Solution - Fix them ## Testing ``` cargo build -p bevy_winit --no-default-features --features winit/x11 cargo clippy --target wasm32-unknown-unknown -p bevy_winit --no-deps -- -D warnings ```
1 parent a98b568 commit 764be91

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

crates/bevy_winit/src/winit_windows.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,16 @@ impl WinitWindows {
190190
bevy_log::debug!("{display_info}");
191191

192192
#[cfg(any(
193-
target_os = "linux",
194-
target_os = "dragonfly",
195-
target_os = "freebsd",
196-
target_os = "netbsd",
197-
target_os = "openbsd",
193+
all(
194+
any(feature = "wayland", feature = "x11"),
195+
any(
196+
target_os = "linux",
197+
target_os = "dragonfly",
198+
target_os = "freebsd",
199+
target_os = "netbsd",
200+
target_os = "openbsd",
201+
)
202+
),
198203
target_os = "windows"
199204
))]
200205
if let Some(name) = &window.name {
@@ -285,7 +290,7 @@ impl WinitWindows {
285290
let canvas = canvas.dyn_into::<web_sys::HtmlCanvasElement>().ok();
286291
winit_window_attributes = winit_window_attributes.with_canvas(canvas);
287292
} else {
288-
panic!("Cannot find element: {}.", selector);
293+
panic!("Cannot find element: {selector}.");
289294
}
290295
}
291296

0 commit comments

Comments
 (0)