fix(ci): restore variables broken by cargo fix --broken-code
Restore handle_pressed/handle_released imports and window/show_capsule/ visible/audio_timeout/duration_ms variable names that cargo fix renamed with _ prefix. These are used on macOS/Windows but the _ prefix broke the builds. Add platform-gated import for model_dir in test_run.rs. Expand cfg_attr allow lists to cover unused_imports and unused_variables where needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
72b53520f2
commit
b4d0f1e36e
4 files changed
+16
-14
No files matched your search
@@ -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<RawTranscript> {
|
||||
let _duration_ms = pcm_duration_ms(pcm);
|
||||
let duration_ms = pcm_duration_ms(pcm);
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user