diff --git a/openless-all/app/src-tauri/src/asr/local/foundry_provider.rs b/openless-all/app/src-tauri/src/asr/local/foundry_provider.rs index f4d65114..c8f26495 100644 --- a/openless-all/app/src-tauri/src/asr/local/foundry_provider.rs +++ b/openless-all/app/src-tauri/src/asr/local/foundry_provider.rs @@ -1,4 +1,4 @@ -#![allow(dead_code)] // Task 6 接入 coordinator 后这些路径会变成运行时路径。 +#![allow(dead_code, unused_variables)] // Task 6 接入 coordinator 后这些路径会变成运行时路径。 #[cfg(target_os = "windows")] use std::fs::{self, OpenOptions}; @@ -93,9 +93,9 @@ impl FoundryLocalWhisperAsr { async fn transcribe_inner( &self, pcm: &[u8], - _audio_timeout: std::time::Duration, + audio_timeout: std::time::Duration, ) -> Result { - let _duration_ms = pcm_duration_ms(pcm); + let duration_ms = pcm_duration_ms(pcm); #[cfg(not(target_os = "windows"))] { diff --git a/openless-all/app/src-tauri/src/asr/local/test_run.rs b/openless-all/app/src-tauri/src/asr/local/test_run.rs index 6b65b34c..322aa49c 100644 --- a/openless-all/app/src-tauri/src/asr/local/test_run.rs +++ b/openless-all/app/src-tauri/src/asr/local/test_run.rs @@ -19,6 +19,8 @@ use anyhow::Result; use serde::Serialize; use super::models::ModelId; +#[cfg(target_os = "macos")] +use super::models::model_dir; /// 内嵌测试音频。原始文件 `vendor/qwen-asr/samples/test_speech.wav` /// 内容:"Hello. This is a test of the Voxtrail speech-to-text system." diff --git a/openless-all/app/src-tauri/src/coordinator.rs b/openless-all/app/src-tauri/src/coordinator.rs index d647b08f..9a6edb2e 100644 --- a/openless-all/app/src-tauri/src/coordinator.rs +++ b/openless-all/app/src-tauri/src/coordinator.rs @@ -1,4 +1,4 @@ -#![cfg_attr(target_os = "linux", allow(dead_code))] +#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))] //! Dictation coordinator. //! //! Mirrors the Swift `DictationCoordinator` state machine. Single owner of @@ -65,8 +65,8 @@ mod resources; #[cfg(test)] use dictation::dictation_error_code; use dictation::{ - begin_session, cancel_session, end_session, handle_pressed_edge, - handle_released_edge, request_stop_during_starting, + begin_session, cancel_session, end_session, handle_pressed, handle_pressed_edge, + handle_released, handle_released_edge, request_stop_during_starting, }; use qa::{close_qa_panel, handle_qa_hotkey_pressed, QaPhase, QaSessionState}; #[cfg(test)] @@ -4979,7 +4979,7 @@ fn emit_capsule( // visible / translation 是「这一帧 capsule:state event 的 payload」内容 —— // 必须在 call-site(即音频线程触发 emit_capsule 时)就算定,否则 main thread // 闭包里读到的将是「下一帧」的 state,跟实际下发给 JS 的 payload 不一致。 - let _visible = !matches!(state, CapsuleState::Idle); + let visible = !matches!(state, CapsuleState::Idle); // Linux: 通过 fcitx5 插件在候选词列表下方显示听写状态,不干扰输入法预编辑。 // 只在文本变化时调用 DBus,避免录音中 ~30Hz 的音频电平回调重复调用。 @@ -5072,10 +5072,10 @@ fn emit_capsule( let inner_for_main = Arc::clone(inner); let app_for_main = app.clone(); let _ = app.run_on_main_thread(move || { - let Some(_window) = app_for_main.get_webview_window("capsule") else { + let Some(window) = app_for_main.get_webview_window("capsule") else { return; }; - let _show_capsule = inner_for_main.prefs.get().show_capsule; + let show_capsule = inner_for_main.prefs.get().show_capsule; // Linux: 不操作胶囊窗口(不 show/hide,不 reposition)。 // 文字通过 fcitx5 插件直接 commit,用户始终在目标 app 中。 #[cfg(target_os = "linux")] diff --git a/openless-all/app/src-tauri/src/insertion.rs b/openless-all/app/src-tauri/src/insertion.rs index b63201d3..2d8c454b 100644 --- a/openless-all/app/src-tauri/src/insertion.rs +++ b/openless-all/app/src-tauri/src/insertion.rs @@ -1,4 +1,4 @@ -#![cfg_attr(target_os = "linux", allow(dead_code))] +#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))] //! 跨平台光标位置文本插入。 //! //! 通用步骤:先写剪贴板(模拟失败时用户能手动粘贴)→ 模拟粘贴快捷键。 @@ -37,8 +37,8 @@ impl TextInserter { pub fn insert( &self, text: &str, - _restore_clipboard_after_paste: bool, - _paste_shortcut: PasteShortcut, + restore_clipboard_after_paste: bool, + paste_shortcut: PasteShortcut, ) -> InsertStatus { if text.is_empty() { return InsertStatus::CopiedFallback; @@ -91,8 +91,8 @@ impl TextInserter { pub fn insert( &self, text: &str, - _restore_clipboard_after_paste: bool, - _paste_shortcut: PasteShortcut, + restore_clipboard_after_paste: bool, + paste_shortcut: PasteShortcut, ) -> InsertStatus { if text.is_empty() { return InsertStatus::CopiedFallback;