From fcb928bf744a6dbe7289ddfba730087e0e89a448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Pe=CC=81rez?= Date: Tue, 3 Feb 2026 22:03:41 +0000 Subject: [PATCH] chore: fix format and clippy --- .../src/services/provider_analytics_service.rs | 11 ++++------- crates/vapora-backend/src/workflow/parser.rs | 2 +- crates/vapora-backend/src/workflow/scheduler.rs | 1 + 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/vapora-backend/src/services/provider_analytics_service.rs b/crates/vapora-backend/src/services/provider_analytics_service.rs index e2355ce..be0bd6f 100644 --- a/crates/vapora-backend/src/services/provider_analytics_service.rs +++ b/crates/vapora-backend/src/services/provider_analytics_service.rs @@ -200,10 +200,8 @@ impl ProviderAnalyticsService { } task_count += 1; - if let Some(outcome) = obj.get("outcome").and_then(|v| v.as_str()) { - if outcome == "success" { - successful_count += 1; - } + if matches!(obj.get("outcome").and_then(|v| v.as_str()), Some("success")) { + successful_count += 1; } if let Some(duration) = obj.get("duration_ms").and_then(|v| v.as_u64()) { @@ -235,6 +233,7 @@ impl ProviderAnalyticsService { } /// Get cost forecast for a provider + #[allow(clippy::excessive_nesting)] pub async fn forecast_provider_costs( &self, provider: &str, @@ -271,14 +270,12 @@ impl ProviderAnalyticsService { if let Some(executed_at) = obj.get("executed_at").and_then(|v| v.as_str()) { let date_str = executed_at.split('T').next().unwrap_or("").to_string(); - - if let Some(ref last_date) = last_date_str { + if let Some(ref last_date) = &last_date_str { if last_date != &date_str && current_day_cost > 0 { daily_costs.push(current_day_cost); current_day_cost = 0; } } - last_date_str = Some(date_str); } diff --git a/crates/vapora-backend/src/workflow/parser.rs b/crates/vapora-backend/src/workflow/parser.rs index ed9ada5..fca0afe 100644 --- a/crates/vapora-backend/src/workflow/parser.rs +++ b/crates/vapora-backend/src/workflow/parser.rs @@ -9,7 +9,7 @@ use thiserror::Error; use crate::workflow::state::{Phase, StepStatus, Workflow, WorkflowStep}; #[derive(Debug, Error)] -#[allow(dead_code)] +#[allow(dead_code, clippy::enum_variant_names)] pub enum ParserError { #[error("Failed to read file: {0}")] FileError(#[from] std::io::Error), diff --git a/crates/vapora-backend/src/workflow/scheduler.rs b/crates/vapora-backend/src/workflow/scheduler.rs index 563e5c1..466429e 100644 --- a/crates/vapora-backend/src/workflow/scheduler.rs +++ b/crates/vapora-backend/src/workflow/scheduler.rs @@ -24,6 +24,7 @@ pub struct Scheduler; impl Scheduler { /// Resolve dependencies using topological sort (Kahn's algorithm) /// Returns levels of steps that can be executed in parallel + #[allow(clippy::excessive_nesting)] pub fn resolve_dependencies( steps: &[WorkflowStep], ) -> Result>, SchedulerError> {