Skip to content
Open
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: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ members = [
]
exclude = [
"plugins/apple-calendar",
"plugins/apple-contact",
"plugins/cli2",
"plugins/db",
"plugins/extensions",
"plugins/pdf",
"crates/vad-ext",
]

Expand Down
10 changes: 5 additions & 5 deletions apps/cli/src/commands/connect/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ impl App {
match self.step {
Step::SelectProvider => {
if let Some(provider) = self.provider {
if let Some(ct) = self.connection_type {
if provider.valid_for(ct) {
self.step = Step::InputBaseUrl;
continue;
}
if let Some(ct) = self.connection_type
&& provider.valid_for(ct)
{
self.step = Step::InputBaseUrl;
continue;
}
self.provider = None;
}
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/commands/connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ struct ConnectScreen {
impl ConnectScreen {
fn apply_effects(&mut self, effects: Vec<Effect>) -> ScreenControl<Option<SaveData>> {
for effect in effects {
match effect {
Effect::Save(data) => return ScreenControl::Exit(Some(data)),
Effect::Exit => return ScreenControl::Exit(None),
}
return match effect {
Effect::Save(data) => ScreenControl::Exit(Some(data)),
Effect::Exit => ScreenControl::Exit(None),
};
}
ScreenControl::Continue
}
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/entry/ui/command_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ use ratatui::{

use crate::theme::Theme;

#[derive(Default)]
pub struct CursorState {
pub position: Option<Position>,
}

impl Default for CursorState {
fn default() -> Self {
Self { position: None }
}
}

pub struct CommandInput<'a> {
value: &'a str,
cursor_col: usize,
Expand Down
16 changes: 7 additions & 9 deletions apps/cli/src/commands/listen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,13 @@ impl ListenScreen {

fn apply_effects(&mut self, effects: Vec<Effect>) -> ScreenControl<Output> {
for effect in effects {
match effect {
Effect::Exit { force } => {
return ScreenControl::Exit(Output {
elapsed: self.app.elapsed(),
force_quit: force,
segments: self.app.segments(),
});
}
}
return match effect {
Effect::Exit { force } => ScreenControl::Exit(Output {
elapsed: self.app.elapsed(),
force_quit: force,
segments: self.app.segments(),
}),
};
}

ScreenControl::Continue
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/commands/sessions/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ impl App {
Vec::new()
}
KeyCode::Enter => {
if let Some(idx) = self.list_state.selected() {
if let Some(session) = self.sessions.get(idx) {
return vec![Effect::Select(session.id.clone())];
}
if let Some(idx) = self.list_state.selected()
&& let Some(session) = self.sessions.get(idx)
{
return vec![Effect::Select(session.id.clone())];
}
Vec::new()
}
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/commands/sessions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ struct SessionsScreen {
impl SessionsScreen {
fn apply_effects(&mut self, effects: Vec<Effect>) -> ScreenControl<Option<String>> {
for effect in effects {
match effect {
Effect::Select(id) => return ScreenControl::Exit(Some(id)),
Effect::Exit => return ScreenControl::Exit(None),
}
return match effect {
Effect::Select(id) => ScreenControl::Exit(Some(id)),
Effect::Exit => ScreenControl::Exit(None),
};
}
ScreenControl::Continue
}
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/config/stt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl Provider {
}
}

#[allow(clippy::wrong_self_convention)]
fn to_batch_provider(&self) -> BatchProvider {
match self {
Provider::Deepgram => BatchProvider::Deepgram,
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use hypr_cli_editor::StyleSheet;
use ratatui::style::{Color, Modifier, Style};

#[derive(Debug, Clone, Copy)]
#[allow(dead_code)]
pub struct Theme {
pub bg: Color,
pub accent: Style,
Expand Down
16 changes: 8 additions & 8 deletions crates/audio-actual/src/rt_ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

let convert_count = count.min(vacant);

for i in 0..convert_count {
scratch[i] = data[offset + i].to_sample_();
for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) {
*slot = data[offset + i].to_sample_();
}

let pushed = producer.push_slice(&scratch[..convert_count]);
Expand All @@ -76,8 +76,8 @@

let convert_count = count.min(vacant);

for i in 0..convert_count {
scratch[i] = data[(offset + i) * channels].to_sample_();
for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) {
*slot = data[(offset + i) * channels].to_sample_();
}

let pushed = producer.push_slice(&scratch[..convert_count]);
Expand All @@ -93,7 +93,7 @@
}
}

pub(crate) fn convert_and_push_to_ringbuf<T, P>(

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `convert_and_push_to_ringbuf` is never used

Check warning on line 96 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (macos, depot-macos-15)

function `convert_and_push_to_ringbuf` is never used
samples: &[T],
scratch: &mut [f32],
producer: &mut P,
Expand Down Expand Up @@ -126,8 +126,8 @@

let convert_count = count.min(vacant);

for i in 0..convert_count {
scratch[i] = convert(samples[offset + i]);
for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) {
*slot = convert(samples[offset + i]);
}

let pushed = producer.push_slice(&scratch[..convert_count]);
Expand All @@ -143,7 +143,7 @@
}
}

pub(crate) fn push_f32_to_ringbuf<P>(data: &[f32], producer: &mut P) -> PushStats

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `push_f32_to_ringbuf` is never used

Check warning on line 146 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (macos, depot-macos-15)

function `push_f32_to_ringbuf` is never used
where
P: Producer<Item = f32>,
{
Expand All @@ -159,7 +159,7 @@
}

#[cfg_attr(not(any(target_os = "linux", target_os = "windows")), allow(dead_code))]
pub(crate) fn push_f32le_bytes_first_channel_to_ringbuf<P>(

Check warning on line 162 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-x86_64, depot-ubuntu-22.04-8)

function `push_f32le_bytes_first_channel_to_ringbuf` is never used

Check warning on line 162 in crates/audio-actual/src/rt_ring.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (linux-aarch64, depot-ubuntu-22.04-arm-8)

function `push_f32le_bytes_first_channel_to_ringbuf` is never used
data: &[u8],
channels: usize,
scratch: &mut [f32],
Expand Down Expand Up @@ -197,9 +197,9 @@

let convert_count = count.min(vacant);

for i in 0..convert_count {
for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) {
let byte_offset = (offset + i) * frame_size;
scratch[i] = f32::from_le_bytes([
*slot = f32::from_le_bytes([
data[byte_offset],
data[byte_offset + 1],
data[byte_offset + 2],
Expand Down
1 change: 1 addition & 0 deletions crates/cactus/src/stt/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub fn transcribe_stream(
}
}

#[allow(clippy::too_many_arguments)]
fn run_transcribe_worker(
model: Arc<Model>,
options: TranscribeOptions,
Expand Down
1 change: 1 addition & 0 deletions crates/cli-editor/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ impl Buffer {
}
}

#[allow(dead_code)]
pub fn clear(&mut self) {
self.lines.clear();
self.lines.push(String::new());
Expand Down
45 changes: 23 additions & 22 deletions crates/cli-editor/src/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ impl<S: StyleSheet> Highlighter<S> {
styles[line_idx].push((local_start..local_end, style));
}
// Record link info if inside a link
if let Some(url) = link_url_stack.last() {
if line_idx < links.len() {
links[line_idx].push(LinkInfo {
range: local_start..local_end,
url: url.clone(),
});
}
if let Some(url) = link_url_stack.last()
&& line_idx < links.len()
{
links[line_idx].push(LinkInfo {
range: local_start..local_end,
url: url.clone(),
});
}
}
}
Expand All @@ -244,25 +244,26 @@ impl<S: StyleSheet> Highlighter<S> {
result: &mut [Vec<(Range<usize>, Style)>],
lines: &[String],
) {
if let Some(lang) = lang {
if let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang) {
let theme = &THEME_SET.themes["base16-ocean.dark"];
let mut h = HighlightLines::new(syntax, theme);
for (i, code_line) in LinesWithEndings::from(code).enumerate() {
let line_idx = start_line + i;
if line_idx >= result.len() {
break;
}
if let Ok(ranges) = h.highlight_line(code_line, &SYNTAX_SET) {
let escaped = as_24_bit_terminal_escaped(&ranges, false);
if let Ok(text) = escaped.into_text() {
apply_syntect_line(&text, line_idx, result, lines);
}
if let Some(lang) = lang
&& let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang)
{
let theme = &THEME_SET.themes["base16-ocean.dark"];
let mut h = HighlightLines::new(syntax, theme);
for (i, code_line) in LinesWithEndings::from(code).enumerate() {
let line_idx = start_line + i;
if line_idx >= result.len() {
break;
}
if let Ok(ranges) = h.highlight_line(code_line, &SYNTAX_SET) {
let escaped = as_24_bit_terminal_escaped(&ranges, false);
if let Ok(text) = escaped.into_text() {
apply_syntect_line(&text, line_idx, result, lines);
}
}
return;
}
return;
}

// Fallback: style code block content with code_fence style
let style = self.styles.code_fence();
for (i, code_line) in code.lines().enumerate() {
Expand Down
6 changes: 6 additions & 0 deletions crates/cli-tui/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ pub struct TerminalGuard {
inline: bool,
}

impl Default for TerminalGuard {
fn default() -> Self {
Self::new()
}
}

impl TerminalGuard {
pub fn new() -> Self {
install_panic_hook();
Expand Down
20 changes: 10 additions & 10 deletions crates/device-monitor/src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,16 @@ fn handle_volume_mute_event<S: EventSender>(sender: &S, addr: &ca::PropAddr) {
addr.element,
);
}
} else if addr.scope == ca::PropScope::INPUT {
if let Ok(device) = ca::System::default_input_device() {
send_mute_update(
sender,
&device,
ca::PropSelector::DEVICE_MUTE,
ca::PropScope::INPUT,
addr.element,
);
}
} else if addr.scope == ca::PropScope::INPUT
&& let Ok(device) = ca::System::default_input_device()
{
send_mute_update(
sender,
&device,
ca::PropSelector::DEVICE_MUTE,
ca::PropScope::INPUT,
addr.element,
);
}
}
_ => {}
Expand Down
1 change: 1 addition & 0 deletions crates/listener-core/src/actors/recorder/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub(super) fn has_existing_audio(session_dir: &Path) -> bool {
encoded_path.exists() || wav_path.exists() || ogg_path.exists()
}

#[allow(dead_code)]
pub(super) fn infer_existing_audio_channels(
session_dir: &Path,
) -> Result<Option<u16>, ActorProcessingErr> {
Expand Down
3 changes: 3 additions & 0 deletions crates/listener-core/src/actors/recorder/memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use ractor::ActorProcessingErr;
use super::{RecorderEncoder, disk};
use retained_audio::{MemoryRetentionPolicy, RetainedAudio};

#[allow(dead_code)]
const DEFAULT_MEMORY_RETENTION: MemoryRetentionPolicy =
MemoryRetentionPolicy::KeepLast(Duration::from_secs(60 * 60));

Expand All @@ -19,10 +20,12 @@ pub(super) struct MemorySink {
retained: RetainedAudio,
}

#[allow(dead_code)]
pub(super) fn create_memory_sink(session_dir: &Path) -> Result<MemorySink, ActorProcessingErr> {
create_memory_sink_with_retention(session_dir, DEFAULT_MEMORY_RETENTION)
}

#[allow(dead_code)]
fn create_memory_sink_with_retention(
session_dir: &Path,
retention: MemoryRetentionPolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::VecDeque;
use std::time::Duration;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(dead_code)]
pub(super) enum MemoryRetentionPolicy {
KeepLast(Duration),
}
Expand All @@ -20,6 +21,7 @@ pub(super) struct RetainedAudio {
}

impl RetainedAudio {
#[allow(dead_code)]
pub(super) fn new(retention: MemoryRetentionPolicy) -> Self {
Self {
retention,
Expand Down
1 change: 1 addition & 0 deletions crates/listener-core/src/actors/recorder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum RecorderSink {
Disabled,
}

#[allow(dead_code)]
enum RecorderEncoder {
Mono(hypr_mp3::MonoStreamEncoder),
Stereo(hypr_mp3::StereoStreamEncoder),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub(super) async fn try_restart_recorder(
let cell = spawn_with_retry(&RETRY_STRATEGY, || {
let sup = sup.clone();
let ctx = ctx.clone();
async move { Ok(spawn_recorder(sup, &ctx).await?) }
async move { spawn_recorder(sup, &ctx).await }
})
.await;

Expand Down
9 changes: 4 additions & 5 deletions crates/owhisper-client/src/adapter/cactus/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,13 @@ impl<S> SseParserState<S> {
&mut self,
response: StreamResponse,
) -> Option<Result<StreamingBatchEvent, Error>> {
if let StreamResponse::TranscriptResponse { channel, .. } = &response {
if channel
if let StreamResponse::TranscriptResponse { channel, .. } = &response
&& channel
.alternatives
.first()
.is_some_and(|a| !a.words.is_empty())
{
self.saw_segment_words = true;
}
{
self.saw_segment_words = true;
}

let segment_end = match &response {
Expand Down
6 changes: 3 additions & 3 deletions crates/owhisper-client/src/adapter/soniox/live.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ fn build_words(tokens: &[&soniox::Token]) -> Vec<owhisper_interface::stream::Wor
.collect()
}

fn partition_tokens_by_word_finality<'a>(
tokens: &'a [soniox::Token],
) -> (Vec<&'a soniox::Token>, Vec<&'a soniox::Token>) {
fn partition_tokens_by_word_finality(
tokens: &[soniox::Token],
) -> (Vec<&soniox::Token>, Vec<&soniox::Token>) {
let mut final_tokens = Vec::new();
let mut non_final_tokens = Vec::new();
for group in token_groups_from_values(tokens) {
Expand Down
1 change: 1 addition & 0 deletions crates/transcribe-cactus/src/service/batch/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ fn chunk_channel_audio(
}
}

#[allow(clippy::too_many_arguments)]
fn transcribe_chunks(
channel_idx: usize,
chunks: &[hypr_vad_chunking::AudioChunk],
Expand Down
Loading
Loading