Skip to content
Closed
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
8 changes: 4 additions & 4 deletions apps/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ fn init_tracing_capture(level: tracing_subscriber::filter::LevelFilter, buffer:

fn analytics_client() -> hypr_analytics::AnalyticsClient {
let mut builder = hypr_analytics::AnalyticsClientBuilder::default();
if std::env::var_os("DO_NOT_TRACK").is_none() {
if let Some(key) = option_env!("POSTHOG_API_KEY") {
builder = builder.with_posthog(key);
}
if std::env::var_os("DO_NOT_TRACK").is_none()
&& let Some(key) = option_env!("POSTHOG_API_KEY")
{
builder = builder.with_posthog(key);
}
builder.build()
}
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/stt/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub async fn resolve_config(
None => None,
};
#[cfg(not(feature = "desktop"))]
let settings: Option<()> = None;
let _settings: Option<()> = None;

let (provider, saved_model) = match overrides.provider {
Some(p) => (p, None),
Expand All @@ -122,9 +122,9 @@ pub async fn resolve_config(
.as_ref()
.and_then(|s| s.stt_providers.get(provider.id()));
#[cfg(not(feature = "desktop"))]
let saved: Option<&()> = None;
let _saved: Option<&()> = None;

let base_url = overrides.base_url.or_else(|| {
let base_url = overrides.base_url.or({
#[cfg(feature = "desktop")]
{
saved.and_then(|s| s.base_url.clone())
Expand All @@ -134,7 +134,7 @@ pub async fn resolve_config(
None
}
});
let api_key = overrides.api_key.or_else(|| {
let api_key = overrides.api_key.or({
#[cfg(feature = "desktop")]
{
saved.and_then(|s| s.api_key.clone())
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/stt/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl SttProvider {
}
}

pub(crate) fn to_batch_provider(&self) -> BatchProvider {
pub(crate) fn to_batch_provider(self) -> BatchProvider {
match self {
SttProvider::Deepgram => BatchProvider::Deepgram,
SttProvider::Soniox => BatchProvider::Soniox,
Expand Down
8 changes: 4 additions & 4 deletions crates/api-ticket/src/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ fn github_state(issue: &hypr_github_issues::Issue) -> (TicketState, Option<Strin
match issue.state.as_str() {
"open" => (TicketState::Open, Some("open".to_string())),
"closed" => {
if let Some(ref pr) = issue.pull_request {
if pr.merged_at.is_some() {
return (TicketState::Done, Some("merged".to_string()));
}
if let Some(ref pr) = issue.pull_request
&& pr.merged_at.is_some()
{
return (TicketState::Done, Some("merged".to_string()));
}
match issue.state_reason.as_deref() {
Some("completed") => (TicketState::Done, Some("completed".to_string())),
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
9 changes: 4 additions & 5 deletions crates/calendar/src/sync/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,15 @@ pub fn normalize_calendar_event(
if attendee.role == hypr_calendar_interface::AttendeeRole::NonParticipant {
continue;
}
if let Some(ref org_email) = organizer_email {
if attendee
if let Some(ref org_email) = organizer_email
&& attendee
.email
.as_deref()
.map(|e| e.to_lowercase())
.as_deref()
== Some(org_email)
{
continue;
}
{
continue;
}
participants.push(EventParticipant {
name: attendee.name.clone(),
Expand Down
8 changes: 4 additions & 4 deletions crates/calendar/src/sync/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async fn sync_calendars_for_provider(
) -> Result<(), SyncError> {
let mut per_connection = Vec::new();
for connection_id in connection_ids {
match list_calendars(api_base_url, access_token, provider.clone(), connection_id).await {
match list_calendars(api_base_url, access_token, *provider, connection_id).await {
Ok(cals) => per_connection.push((connection_id.clone(), cals)),
Err(e) => {
tracing::warn!(
Expand Down Expand Up @@ -176,11 +176,11 @@ async fn sync_events_for_connection(
.map(|cal| {
let api_base_url = api_base_url.to_owned();
let access_token = access_token.to_owned();
let provider = provider.clone();
let provider = *provider;
let connection_id = connection_id.to_owned();
let filter = EventFilter {
from: from.into(),
to: to.into(),
from,
to,
calendar_tracking_id: cal.tracking_id.clone(),
};
let tracking_id = cal.tracking_id.clone();
Expand Down
1 change: 1 addition & 0 deletions crates/db-app/src/aliases_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use sqlx::SqlitePool;

use crate::{AliasRow, insert_human};

#[allow(clippy::too_many_arguments)]
pub async fn upsert_alias(
pool: &SqlitePool,
id: &str,
Expand Down
1 change: 1 addition & 0 deletions crates/db-app/src/calendars_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub async fn has_calendars(pool: &SqlitePool) -> Result<bool, sqlx::Error> {
Ok(has_any)
}

#[allow(clippy::too_many_arguments)]
pub async fn upsert_calendar(
pool: &SqlitePool,
id: &str,
Expand Down
2 changes: 2 additions & 0 deletions crates/db-app/src/events_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use sqlx::{Row, SqlitePool};

use crate::{EventParticipantRow, EventRow};

#[allow(clippy::too_many_arguments)]
pub async fn upsert_event(
pool: &SqlitePool,
id: &str,
Expand Down Expand Up @@ -165,6 +166,7 @@ fn map_event_row(row: &sqlx::sqlite::SqliteRow) -> EventRow {
}
}

#[allow(clippy::too_many_arguments)]
pub async fn upsert_event_participant(
pool: &SqlitePool,
id: &str,
Expand Down
1 change: 1 addition & 0 deletions crates/db-app/src/slack_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ pub async fn get_slack_thread(
))
}

#[allow(clippy::too_many_arguments)]
pub async fn insert_slack_message(
pool: &SqlitePool,
id: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/db-core2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Db3 {

pub async fn connect_local_plain(path: impl AsRef<Path>) -> Result<Self, sqlx::Error> {
if let Some(parent) = path.as_ref().parent() {
std::fs::create_dir_all(parent).map_err(|e| sqlx::Error::Io(e))?;
std::fs::create_dir_all(parent).map_err(sqlx::Error::Io)?;
}
let options = SqliteConnectOptions::new()
.filename(path)
Expand Down
5 changes: 2 additions & 3 deletions crates/db-watch/src/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn build_alias_map(
}

// Strip trailing comma/paren from the table token
let raw_table = tokens[table_idx].trim_end_matches(|c| c == ',' || c == ')');
let raw_table = tokens[table_idx].trim_end_matches([',', ')']);
if !known_tables.contains(raw_table) {
continue;
}
Expand All @@ -98,8 +98,7 @@ fn build_alias_map(
};

if alias_idx < tokens.len() {
let alias =
tokens[alias_idx].trim_end_matches(|c: char| c == ',' || c == ')' || c == ';');
let alias = tokens[alias_idx].trim_end_matches([',', ')', ';']);
let alias_upper = alias.to_uppercase();
if !alias.is_empty()
&& !matches!(
Expand Down
32 changes: 16 additions & 16 deletions crates/fs-sync-core/src/audio/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ where
)?;
}

if let Some(total) = total_frames {
if let Some(ref mut cb) = on_progress {
cb(processed_frames as f64 / total as f64);
}
if let Some(total) = total_frames
&& let Some(ref mut cb) = on_progress
{
cb(processed_frames as f64 / total as f64);
}
}

Expand Down Expand Up @@ -184,10 +184,10 @@ where
left_chunk.clear();
right_chunk.clear();

if let Some(total) = total_frames {
if let Some(ref mut cb) = on_progress {
cb(processed_frames as f64 / total as f64);
}
if let Some(total) = total_frames
&& let Some(ref mut cb) = on_progress
{
cb(processed_frames as f64 / total as f64);
}
}

Expand Down Expand Up @@ -241,10 +241,10 @@ where

state.encode_chunk(&mut encoder, &mut output, None)?;

if let Some(total) = total_frames {
if let Some(ref mut cb) = on_progress {
cb(processed_frames as f64 / total as f64);
}
if let Some(total) = total_frames
&& let Some(ref mut cb) = on_progress
{
cb(processed_frames as f64 / total as f64);
}
}

Expand Down Expand Up @@ -284,10 +284,10 @@ where
encode_mono_chunk(&mut encoder, &mono_chunk, &mut mono_pcm, &mut output)?;
mono_chunk.clear();

if let Some(total) = total_frames {
if let Some(ref mut cb) = on_progress {
cb(processed_frames as f64 / total as f64);
}
if let Some(total) = total_frames
&& let Some(ref mut cb) = on_progress
{
cb(processed_frames as f64 / total as f64);
}
}

Expand Down
21 changes: 2 additions & 19 deletions crates/fs-sync-core/src/audio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,27 +134,10 @@ fn with_afconvert_fallback<F, T>(
where
F: FnMut(&Path, Option<&mut dyn FnMut(f64)>) -> Result<T, AudioProcessingError>,
{
match try_fn(
try_fn(
source_path,
on_progress.as_mut().map(|p| p as &mut dyn FnMut(f64)),
) {
Ok(val) => Ok(val),
Err(_first_err) => {
#[cfg(target_os = "macos")]
{
let wav_path = hypr_afconvert::to_wav(source_path)
.map_err(|e| AudioProcessingError::AfconvertFailed(e.to_string()))?;
let result = try_fn(
&wav_path,
on_progress.as_mut().map(|p| p as &mut dyn FnMut(f64)),
);
let _ = std::fs::remove_file(&wav_path);
result
}
#[cfg(not(target_os = "macos"))]
Err(_first_err)
}
}
)
}

fn decode_with_rodio<W: Write>(
Expand Down
18 changes: 9 additions & 9 deletions crates/github-issues/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ impl<C: HttpClient> GitHubIssuesClient<C> {
if let Some(ref state) = req.state {
query_parts.push(format!("state={}", state.as_str()));
}
if let Some(ref labels) = req.labels {
if !labels.is_empty() {
let joined = labels
.iter()
.map(|l| urlencoding::encode(l).into_owned())
.collect::<Vec<_>>()
.join(",");
query_parts.push(format!("labels={joined}"));
}
if let Some(ref labels) = req.labels
&& !labels.is_empty()
{
let joined = labels
.iter()
.map(|l| urlencoding::encode(l).into_owned())
.collect::<Vec<_>>()
.join(",");
query_parts.push(format!("labels={joined}"));
}
if let Some(ref assignee) = req.assignee {
query_parts.push(format!("assignee={}", urlencoding::encode(assignee)));
Expand Down
10 changes: 5 additions & 5 deletions crates/linear/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ impl<C: HttpClient> LinearClient<C> {

let response: GraphQLResponse<T> = serde_json::from_slice(&response_bytes)?;

if let Some(errors) = response.errors {
if !errors.is_empty() {
let messages: Vec<_> = errors.iter().map(|e| e.message.as_str()).collect();
return Err(Error::GraphQL(messages.join("; ")));
}
if let Some(errors) = response.errors
&& !errors.is_empty()
{
let messages: Vec<_> = errors.iter().map(|e| e.message.as_str()).collect();
return Err(Error::GraphQL(messages.join("; ")));
}

response
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
3 changes: 1 addition & 2 deletions crates/llm-proxy/src/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,13 @@ async fn completions_handler(
})
.when(is_retryable_error)
.await
.map(|resp| {
.inspect(|_resp| {
tracing::info!(
service.peer.name = %provider_name,
gen_ai.provider.name = %provider_name,
hyprnote.duration_ms = upstream_request_started_at.elapsed().as_millis() as u64,
"llm_upstream_request_finished"
);
resp
})
})
.await;
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 @@ -298,9 +298,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-proxy/src/relay/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl<S> WebSocketProxyBuilder<S> {
}
}

#[allow(clippy::too_many_arguments)]
fn build_from(
request: ClientRequestBuilder,
control_message_types: HashSet<&'static str>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ impl SplitCoordinator {
return actions;
}

if self.should_release_pending_finalize(channel) {
if let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal) {
self.mark_terminal_finalize_sent(generation);
}
if self.should_release_pending_finalize(channel)
&& let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal)
{
self.mark_terminal_finalize_sent(generation);
}

if self.channels.iter().all(|channel| channel.closed) {
Expand Down
Loading
Loading