From 9b378c2a740d4ecadb8c651f5a4312505eb9c568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=86=A0=E8=BE=B0?= Date: Thu, 9 Jul 2026 16:41:34 +0800 Subject: [PATCH] fix(voice): import hotkey items in non-macOS dictation listener MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start_rdev_listener (cfg not(target_os = "macos")) uses the hotkey module's parse_hotkey/start_listener plus the ActivationMode and HotkeyEvent enums, but none were imported — so cargo clippy/build fails on Linux with "cannot find module hotkey" / "cannot find type ActivationMode" / "cannot find type HotkeyEvent". macOS is unaffected because start_rdev_listener is cfg'd out there. Add a cfg-gated use matching the only cfg that references these items (no unused-import warning on macOS). --- src/openhuman/voice/dictation_listener.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openhuman/voice/dictation_listener.rs b/src/openhuman/voice/dictation_listener.rs index a3334b47d5..86676c1418 100644 --- a/src/openhuman/voice/dictation_listener.rs +++ b/src/openhuman/voice/dictation_listener.rs @@ -13,6 +13,11 @@ use tokio::sync::broadcast; use tokio::task::JoinHandle; use crate::openhuman::config::Config; +// Only `start_rdev_listener` (non-macOS) touches the hotkey module — its +// `ActivationMode`, `HotkeyEvent`, and `parse_hotkey`/`start_listener` fns — so +// gate the import to the same cfg to avoid unused-import warnings on macOS. +#[cfg(not(target_os = "macos"))] +use crate::openhuman::voice::hotkey::{self, ActivationMode, HotkeyEvent}; const LOG_PREFIX: &str = "[dictation_listener]";