Merge pull request #577 from aeoform/chore/suppress-linux-build-warnings

chore: suppress all Linux build warnings (192 → 0)
This commit is contained in:
Chris233 authored and GitHub committed 2026-06-03 21:53:23 +08:00
commit 63d3e16757
27 files changed
+36 -5

No files matched your search

@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 火山引擎大模型流式 ASR 二进制帧编解码。
//!
//! 帧结构通常为:4 字节 header + 可选 sequence + 4 字节大端 payload size + payload。
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! 本地 Qwen3-ASR 引擎缓存。
//!
//! 用途:避免每次 dictation 都重加载 1.2GB+ 模型。引擎一次 load 后驻留在内存,
@@ -566,7 +566,7 @@ pub(crate) async fn download_one(
// 1. 计算 chunk 计划
let chunks: Vec<(usize, u64, u64)> = chunk_plan(total_size);
let total_chunks = chunks.len();
let _total_chunks = chunks.len();
// 2. 读已完成的 chunk 索引
let done_set = read_idx(&idx_path);
@@ -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};
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
#[cfg(target_os = "windows")]
#[allow(dead_code)]
mod imp {
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! Windows sherpa-onnx 本地 ASR 的常量、catalog 与事件载荷。
//!
//! 当前 catalog 覆盖 Windows offline batch 模型和实验 online streaming 模型;
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! sherpa-onnx 本地 ASR provider(Windows offline batch + online streaming)。
//!
//! 形状与 `foundry_provider.rs` 对齐:
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! sherpa-onnx 本地 ASR runtime(Windows offline batch + online streaming)。
//!
//! 设计与 `foundry_runtime.rs` 对齐:runtime 是模型/会话/生命周期的单一持有者,
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 本地 Qwen3-ASR 一键"加载 + 测试"实现。
//!
//! 流程:
@@ -17,7 +18,9 @@ use std::time::Instant;
use anyhow::Result;
use serde::Serialize;
use super::models::{model_dir, ModelId};
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,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Volcengine SAUC bigmodel streaming ASR client.
//!
//! Direct port of the Swift `VolcengineStreamingASR`. Battle-tested protocol
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Tauri command surface — every IPC entry the React UI invokes lives here.
use std::sync::Arc;
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! Dictation coordinator.
//!
//! Mirrors the Swift `DictationCoordinator` state machine. Single owner of
@@ -5081,6 +5082,8 @@ fn emit_capsule(
{
return;
}
#[cfg(not(target_os = "linux"))]
{
// 三平台统一:Done / Cancelled / Error 状态保留 ~1.5s toast
// (schedule_capsule_idle 之后会回 Idle 隐藏)。
@@ -5119,6 +5122,7 @@ fn emit_capsule(
hide_capsule_window_if_present();
let _ = window.hide();
}
}
});
let _ = app.emit_to("capsule", "capsule:state", payload);
+1
View File
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code))]
//! 全局热键监听:发送按下 / 抬起 / 取消三类边沿事件。
//!
//! - macOS:原生 CGEventTap(core-foundation + core-graphics FFI),与 Swift
+4 -2
View File
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 跨平台光标位置文本插入。
//!
//! 通用步骤:先写剪贴板(模拟失败时用户能手动粘贴)→ 模拟粘贴快捷键。
@@ -57,6 +58,7 @@ impl TextInserter {
}
}
}
#[cfg(not(target_os = "linux"))]
insert_with_clipboard_restore(text, restore_clipboard_after_paste, paste_shortcut)
}
@@ -89,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;
+1
View File
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! OpenLess Tauri backend.
//!
//! Modules mirror the original Swift libraries (one purpose per file):
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Linux fcitx5 插件 DBus 客户端。
//!
//! 封装对 `org.fcitx.Fcitx.OpenLess1` 接口的调用,
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 系统权限请求 / 检查(macOS / Windows)。
//!
//! 与 Swift `Sources/OpenLessHotkey/AccessibilityPermission.swift` +
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Local persistence: history JSON, user preferences JSON, vocab JSON, and
//! platform-backed credentials vault.
//!
+1
View File
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! OpenAI-compatible chat completions client + polish prompts.
//!
//! 提示词在 `prompts` 模块中维护:使用 `# 角色 / # 任务 / # 通用规则 / # 输出 / # 示例`
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! 跨平台「划词捕获」工具:在用户触发 QA 快捷键时尝试拿到当前前台 app 的选区文本。
//!
//! 三级 fallback:
+1
View File
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Shared value types crossing the IPC boundary.
use serde::{Deserialize, Serialize};
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 跨平台 Unicode keystroke 合成(流式输入用)。
//!
//! 公开 API 三件套:
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use std::time::Duration;
use crate::windows_ime_protocol::ImeSubmitStatus;
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
pub const OPENLESS_TSF_LANG_ID: u16 = 0x0804;
pub const OPENLESS_TEXT_SERVICE_CLSID_BRACED: &str = "{6B9F3F4F-5EE7-42D6-9C61-9F80B03A5D7D}";
pub const OPENLESS_PROFILE_GUID_BRACED: &str = "{9B5F5E04-23F6-47DA-9A26-D221F6C3F02E}";
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use serde::{Deserialize, Serialize};
pub const OPENLESS_IME_PROTOCOL_VERSION: u32 = 1;
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use crate::types::InsertStatus;
use crate::windows_ime_ipc::{ImeSubmitRequest, WindowsImeIpcServer};
use crate::windows_ime_profile::{