diff --git a/api/libs/handlers/src/chats/streaming_parser.rs b/api/libs/handlers/src/chats/streaming_parser.rs index 8164f2370..d3da52954 100644 --- a/api/libs/handlers/src/chats/streaming_parser.rs +++ b/api/libs/handlers/src/chats/streaming_parser.rs @@ -1,7 +1,6 @@ use agents::tools::categories::file_tools::common::generate_deterministic_uuid; use anyhow::Result; use serde_json::Value; -use sha2::Digest; use super::post_chat_handler::{ BusterFile, BusterFileContent, BusterReasoningFile, BusterReasoningMessage, BusterReasoningText, @@ -12,6 +11,12 @@ pub struct StreamingParser { yml_content_regex: regex::Regex, } +impl Default for StreamingParser { + fn default() -> Self { + Self::new() + } +} + impl StreamingParser { pub fn new() -> Self { StreamingParser { diff --git a/api/libs/handlers/src/collections/remove_assets_from_collection_handler.rs b/api/libs/handlers/src/collections/remove_assets_from_collection_handler.rs index 25f5ec808..5c5a0d5bf 100644 --- a/api/libs/handlers/src/collections/remove_assets_from_collection_handler.rs +++ b/api/libs/handlers/src/collections/remove_assets_from_collection_handler.rs @@ -227,7 +227,7 @@ pub async fn remove_assets_from_collection_handler( } }; - if let Some(_) = existing { + if existing.is_some() { // Dashboard is in the collection, soft delete it match diesel::update(collections_to_assets::table) .filter(collections_to_assets::collection_id.eq(collection_id)) @@ -351,7 +351,7 @@ pub async fn remove_assets_from_collection_handler( } }; - if let Some(_) = existing { + if existing.is_some() { // Metric is in the collection, soft delete it match diesel::update(collections_to_assets::table) .filter(collections_to_assets::collection_id.eq(collection_id)) diff --git a/api/libs/handlers/src/dashboards/delete_dashboard_handler.rs b/api/libs/handlers/src/dashboards/delete_dashboard_handler.rs index 21d35945b..813d12b2e 100644 --- a/api/libs/handlers/src/dashboards/delete_dashboard_handler.rs +++ b/api/libs/handlers/src/dashboards/delete_dashboard_handler.rs @@ -38,7 +38,7 @@ pub async fn delete_dashboards_handler( // Execute each operation and track failures for (id, operation) in operations { - if let Err(_) = operation.await { + if (operation.await).is_err() { failed_ids.push(id); } } @@ -62,7 +62,7 @@ pub async fn delete_dashboards_handler( /// Helper function to delete a single dashboard /// Used internally by delete_dashboards_handler -async fn delete_single_dashboard(dashboard_id: Uuid, user_id: &Uuid) -> Result<()> { +async fn delete_single_dashboard(dashboard_id: Uuid, _user_id: &Uuid) -> Result<()> { let mut conn = get_pg_pool().get().await?; // Check if the dashboard exists and is not already deleted diff --git a/api/libs/handlers/src/favorites/create_favorite.rs b/api/libs/handlers/src/favorites/create_favorite.rs index 5eef29834..bc2d7cee9 100644 --- a/api/libs/handlers/src/favorites/create_favorite.rs +++ b/api/libs/handlers/src/favorites/create_favorite.rs @@ -46,7 +46,7 @@ pub async fn create_favorite( }; let user_favorite = UserFavorite { - asset_type: req.asset_type.clone(), + asset_type: req.asset_type, user_id: user.id, asset_id: req.id, order_index: index as i32, diff --git a/api/libs/handlers/src/favorites/update_favorites.rs b/api/libs/handlers/src/favorites/update_favorites.rs index 5d288d163..f685848cf 100644 --- a/api/libs/handlers/src/favorites/update_favorites.rs +++ b/api/libs/handlers/src/favorites/update_favorites.rs @@ -6,7 +6,7 @@ use super::favorites_utils::{list_user_favorites, update_favorites as update_fav pub async fn update_favorites( user: &AuthenticatedUser, - favorites: &Vec, + favorites: &[Uuid], ) -> Result> { match update_favorites_util(user, favorites).await { Ok(_) => (), diff --git a/api/libs/handlers/src/messages/helpers/delete_message_handler.rs b/api/libs/handlers/src/messages/helpers/delete_message_handler.rs index fc5537f6f..b56cce658 100644 --- a/api/libs/handlers/src/messages/helpers/delete_message_handler.rs +++ b/api/libs/handlers/src/messages/helpers/delete_message_handler.rs @@ -14,7 +14,7 @@ use uuid::Uuid; /// /// # Returns /// * `Result<()>` - Success or error -pub async fn delete_message_handler(user: AuthenticatedUser, message_id: Uuid) -> Result<()> { +pub async fn delete_message_handler(_user: AuthenticatedUser, message_id: Uuid) -> Result<()> { let pool = get_pg_pool(); let mut conn = pool.get().await?; diff --git a/api/libs/handlers/src/metrics/post_metric_dashboard_handler.rs b/api/libs/handlers/src/metrics/post_metric_dashboard_handler.rs index 05525f611..c9c5d569b 100644 --- a/api/libs/handlers/src/metrics/post_metric_dashboard_handler.rs +++ b/api/libs/handlers/src/metrics/post_metric_dashboard_handler.rs @@ -83,7 +83,7 @@ pub async fn post_metric_dashboard_handler( match existing { Ok(_) => { - return Ok(PostMetricDashboardResponse { + Ok(PostMetricDashboardResponse { metric_id: *metric_id, dashboard_id: request.dashboard_id, })