Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openless-all/app/src-tauri/src/asr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod frame;
pub mod volcengine;
pub mod whisper;

pub use volcengine::{VolcengineASRError, VolcengineCredentials, VolcengineStreamingASR};
pub use volcengine::{VolcengineCredentials, VolcengineStreamingASR};
pub use whisper::WhisperBatchASR;

/// Sink for raw 16 kHz / 16-bit / mono PCM bytes coming off the recorder.
Expand Down
3 changes: 1 addition & 2 deletions openless-all/app/src-tauri/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ async fn handle_window_hotkey_event(
#[cfg(not(target_os = "windows"))]
{
let _ = (inner, event_type, key, code, repeat);
return Ok(());
Ok(())
}

#[cfg(target_os = "windows")]
Expand Down Expand Up @@ -2599,7 +2599,6 @@ fn maybe_position_capsule_bottom_center<R: tauri::Runtime>(
if crate::position_capsule_bottom_center(window, translation_active).is_ok() {
let mut last = inner.capsule_layout.lock();
*last = Some(next);
return;
}
}

Expand Down
2 changes: 1 addition & 1 deletion openless-all/app/src-tauri/src/hotkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ mod platform {
"hotkey hook 启动超时",
run_listen_loop,
)?;
let _ = listener.startup;
listener.startup;
Ok(Box::new(MacHotkeyAdapter {
shared: listener.shared,
}))
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/insertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//! → CGEventPost,跟我们这里完全同源。
//! 3. 其他平台 (Windows/Linux) 仍用 enigo。

#[cfg(not(target_os = "macos"))]
use std::time::Duration;

use crate::types::InsertStatus;
Expand Down
3 changes: 1 addition & 2 deletions openless-all/app/src-tauri/src/polish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,9 @@ const BOILERPLATE_END_CHARS: &[char] = &['。', ':', ':', ',', ',', '\n'];

fn strip_leading_boilerplate(text: &str) -> &str {
for prefix in LEADING_BOILERPLATE_PREFIXES {
if text.starts_with(prefix) {
if let Some(after_prefix) = text.strip_prefix(prefix) {
// Trim characters after the prefix up to (and including) the first
// sentence-ending punctuation or newline.
let after_prefix = &text[prefix.len()..];
for (idx, c) in after_prefix.char_indices() {
if BOILERPLATE_END_CHARS.contains(&c) {
let cut = prefix.len() + idx + c.len_utf8();
Expand Down
11 changes: 4 additions & 7 deletions openless-all/app/src-tauri/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
#[derive(Default)]
pub enum PolishMode {
Raw,
#[default]
Light,
Structured,
Formal,
}

impl Default for PolishMode {
fn default() -> Self {
PolishMode::Light
}
}

impl PolishMode {
pub fn display_name(&self) -> &'static str {
Expand Down Expand Up @@ -300,7 +297,7 @@ impl HotkeyCapability {
pub fn current() -> Self {
#[cfg(target_os = "macos")]
{
return Self {
Self {
adapter: HotkeyAdapterKind::MacEventTap,
available_triggers: vec![
HotkeyTrigger::RightOption,
Expand All @@ -315,7 +312,7 @@ impl HotkeyCapability {
supports_side_specific_modifiers: true,
explicit_fallback_available: false,
status_hint: Some("授权辅助功能后,通常需要完全退出并重新打开 OpenLess。".into()),
};
}
}

#[cfg(target_os = "windows")]
Expand Down
Loading