From b99651f330c6da2f8fb519921b07a9e141ce8365 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Mon, 6 Jul 2026 02:55:42 +0530 Subject: [PATCH] fix: resolve warnings (partial) - Fix unused variable entry_type -> _entry_type - Remove unused imports BufMut and cache_jobs from companies handlers - Fix doc comment on lazy_static - Add #[allow(dead_code)] to reset_daily_actions and reset_monthly_credits - Fix unused imports in job_seekers handlers --- apps/companies/src/handlers/mod.rs | 2 -- apps/cron/src/tasks/ai.rs | 1 + apps/job_seekers/src/handlers.rs | 1 - crates/cache/src/ollama.rs | 2 +- crates/db/src/models/ai_credits.rs | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/companies/src/handlers/mod.rs b/apps/companies/src/handlers/mod.rs index 5c2722e..8f58449 100644 --- a/apps/companies/src/handlers/mod.rs +++ b/apps/companies/src/handlers/mod.rs @@ -7,8 +7,6 @@ use axum::{ routing::{get, patch, post}, Json, Router, }; -use bytes::BufMut; -use cache::jobs as cache_jobs; use redis::AsyncCommands; use serde::Deserialize; use uuid::Uuid; diff --git a/apps/cron/src/tasks/ai.rs b/apps/cron/src/tasks/ai.rs index a6dfde4..5fe6481 100644 --- a/apps/cron/src/tasks/ai.rs +++ b/apps/cron/src/tasks/ai.rs @@ -1,6 +1,7 @@ use sqlx::PgPool; /// Reset daily_actions_used for all subscriptions every day. +#[allow(dead_code)] pub async fn reset_daily_actions(pool: &PgPool) -> Result<(), sqlx::Error> { let rows = sqlx::query( "UPDATE user_ai_subscriptions SET daily_actions_used = 0, updated_at = NOW()" diff --git a/apps/job_seekers/src/handlers.rs b/apps/job_seekers/src/handlers.rs index 7131c0f..21a31dc 100644 --- a/apps/job_seekers/src/handlers.rs +++ b/apps/job_seekers/src/handlers.rs @@ -7,7 +7,6 @@ use axum::{ Json, Router, }; use bytes::BufMut; -use cache::jobs as cache_jobs; use redis::AsyncCommands; use serde::Deserialize; use uuid::Uuid; diff --git a/crates/cache/src/ollama.rs b/crates/cache/src/ollama.rs index b54199e..59d4057 100644 --- a/crates/cache/src/ollama.rs +++ b/crates/cache/src/ollama.rs @@ -232,7 +232,7 @@ impl CircuitBreaker { } } -/// Global rate limiter instance (shared across all clients) +// Global rate limiter instance (shared across all clients) lazy_static::lazy_static! { static ref GLOBAL_RATE_LIMITER: RateLimiter = RateLimiter::new( std::env::var("OLLAMA_RATE_LIMIT_PER_MINUTE") diff --git a/crates/db/src/models/ai_credits.rs b/crates/db/src/models/ai_credits.rs index 6708aff..fa86316 100644 --- a/crates/db/src/models/ai_credits.rs +++ b/crates/db/src/models/ai_credits.rs @@ -752,7 +752,7 @@ impl AiCreditsRepository { .fetch_optional(&mut *tx) .await?; - let Some((_, debit_credits, entry_type)) = debit_entry else { + let Some((_, debit_credits, _entry_type)) = debit_entry else { tx.rollback().await?; return Err(AiCreditsError::ReservationNotFound); };