From a18364e2b4ec2493aca0722a0f46f1a7bb2e98ab Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 22:05:19 -0800 Subject: [PATCH] Menus: the wasm build has no unused import warning for menu_open The only callers of `menus::menu_open` are the native palette-window code in `panel_docking.rs` and its native tests, so on wasm32 the re-export and the function were unused and `cargo xtask wasm` printed two warnings for them. Both now carry `#[cfg(not(target_arch = "wasm32"))]`. The menu bar still records whether a menu is open on every target. --- crates/ui-egui/src/menus.rs | 1 + crates/ui-egui/src/menus/bar.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index dff97c9a5..3d3f2a8c0 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -58,6 +58,7 @@ mod tree; mod ui_commands; pub use bar::menu_bar; +#[cfg(not(target_arch = "wasm32"))] pub(crate) use bar::menu_open; pub(crate) use bar::{home_key, home_showing}; #[cfg(test)] diff --git a/crates/ui-egui/src/menus/bar.rs b/crates/ui-egui/src/menus/bar.rs index 1d8d00197..c57a21637 100644 --- a/crates/ui-egui/src/menus/bar.rs +++ b/crates/ui-egui/src/menus/bar.rs @@ -68,6 +68,7 @@ fn menu_open_id() -> egui::Id { } /// Whether a menu of the in-window menu bar is open (`false` when no menu bar was drawn yet). +#[cfg(not(target_arch = "wasm32"))] pub(crate) fn menu_open(ctx: &egui::Context) -> bool { ctx.data(|d| d.get_temp::(menu_open_id())).unwrap_or(false) }