fix(refactor): cfg-gate two items so macOS build is warning-clean (#530)

Mac smoke build surfaced 5 dead-code / unused-import warnings, all
cfg-leaks of items that are conditionally compiled on Windows + Linux:

- `psysonic-audio::power_resume` is consumed by `power_notify_win` and
  `power_notify_linux` only — `register_post_sleep_audio_recovery`
  intentionally falls through to a no-op on macOS (the generic device
  watcher covers the resume case there). Gate the module declaration
  to `#[cfg(any(target_os = "windows", target_os = "linux"))]`.

- `lib_commands::ui::build_mini_player_window` is re-exported for the
  Windows-only pre-create path in `lib.rs:setup` (other platforms
  create the mini-player webview lazily on first invoke). Gate the
  re-export to `#[cfg(target_os = "windows")]` so non-Windows builds
  don't warn on an unused import.

Both are non-functional — the items themselves are already correctly
scoped via cfg in their consumers; only the declarations / re-exports
were missing the matching gate.
This commit is contained in:
Frank Stellmacher
2026-05-09 23:34:23 +02:00
committed by GitHub
parent 25507888a9
commit 7a0dd93f3e
2 changed files with 10 additions and 3 deletions
@@ -20,6 +20,7 @@ pub mod radio_commands;
pub mod transport_commands;
mod device_watcher;
mod engine;
#[cfg(any(target_os = "windows", target_os = "linux"))]
mod power_resume;
#[cfg(target_os = "windows")]
mod power_notify_win;
+9 -3
View File
@@ -1,8 +1,14 @@
mod mini;
pub(crate) use mini::{
build_mini_player_window, close_mini_player, open_mini_player, pause_rendering,
persist_mini_pos_throttled, preload_mini_player, resize_mini_player, resume_rendering,
set_mini_player_always_on_top, show_main_window, PAUSE_RENDERING_JS, RESUME_RENDERING_JS,
close_mini_player, open_mini_player, pause_rendering, persist_mini_pos_throttled,
preload_mini_player, resize_mini_player, resume_rendering, set_mini_player_always_on_top,
show_main_window, PAUSE_RENDERING_JS, RESUME_RENDERING_JS,
};
// Pre-create-on-startup is a Windows-only path (see `lib.rs:setup`); other
// platforms create the mini-player webview lazily on first invoke. The
// re-export is gated to match so non-Windows builds don't warn on an
// unused import.
#[cfg(target_os = "windows")]
pub(crate) use mini::build_mini_player_window;
// Bandsintown moved to psysonic-integration; lib.rs uses the full path.