From 11185282c4e6321fdf0eb8564adfc8f6466b0621 Mon Sep 17 00:00:00 2001 From: Priec Date: Sun, 26 Oct 2025 16:07:19 +0100 Subject: [PATCH] cargo fix on server --- server/src/server/services/table_validation_service.rs | 1 - .../src/table_definition/handlers/post_table_definition.rs | 1 - server/src/table_script/handlers/dependency_analyzer.rs | 2 +- .../table_script/comprehensive_error_scenarios_tests.rs | 1 - server/tests/table_script/mathematical_operations_tests.rs | 1 - server/tests/table_script/post_scripts_integration_tests.rs | 1 - server/tests/table_script/prohibited_types_test.rs | 1 - server/tests/table_script/type_safety_comprehensive_tests.rs | 1 - server/tests/tables_data/delete/delete_table_data_test.rs | 3 +-- .../tests/tables_data/get/get_table_data_by_position_test.rs | 1 - server/tests/tables_data/get/get_table_data_test.rs | 5 +---- server/tests/tables_data/get/get_table_data_test2.rs | 2 +- server/tests/tables_data/post/post_table_data_test.rs | 3 +-- server/tests/tables_data/put/put_table_data_test2.rs | 2 +- server/tests/tables_data/put/put_table_data_test5.rs | 2 +- 15 files changed, 7 insertions(+), 20 deletions(-) diff --git a/server/src/server/services/table_validation_service.rs b/server/src/server/services/table_validation_service.rs index 51de2cd..5bd9db7 100644 --- a/server/src/server/services/table_validation_service.rs +++ b/server/src/server/services/table_validation_service.rs @@ -1,6 +1,5 @@ // src/server/services/table_validation_service.rs -use tonic::transport::Server; use sqlx::PgPool; use common::proto::komp_ac::table_validation::table_validation_service_server::TableValidationServiceServer; diff --git a/server/src/table_definition/handlers/post_table_definition.rs b/server/src/table_definition/handlers/post_table_definition.rs index 2522c7c..c96d16d 100644 --- a/server/src/table_definition/handlers/post_table_definition.rs +++ b/server/src/table_definition/handlers/post_table_definition.rs @@ -2,7 +2,6 @@ use tonic::Status; use sqlx::{PgPool, Transaction, Postgres}; -use serde_json::json; use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, TableDefinitionResponse}; use common::proto::komp_ac::table_definition::ColumnDefinition; use crate::table_definition::models::map_field_type; diff --git a/server/src/table_script/handlers/dependency_analyzer.rs b/server/src/table_script/handlers/dependency_analyzer.rs index dd82f5e..7b24739 100644 --- a/server/src/table_script/handlers/dependency_analyzer.rs +++ b/server/src/table_script/handlers/dependency_analyzer.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use tonic::Status; use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; +use serde_json::Value; /// Represents the state of a node during dependency graph traversal. #[derive(Clone, Copy, PartialEq)] diff --git a/server/tests/table_script/comprehensive_error_scenarios_tests.rs b/server/tests/table_script/comprehensive_error_scenarios_tests.rs index f59b2ab..b374bb7 100644 --- a/server/tests/table_script/comprehensive_error_scenarios_tests.rs +++ b/server/tests/table_script/comprehensive_error_scenarios_tests.rs @@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script; // Fi use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_definition::ColumnDefinition; use rstest::*; -use serde_json::json; use sqlx::PgPool; /// Helper function to create a test table with specified columns diff --git a/server/tests/table_script/mathematical_operations_tests.rs b/server/tests/table_script/mathematical_operations_tests.rs index 51a55ec..be9be2d 100644 --- a/server/tests/table_script/mathematical_operations_tests.rs +++ b/server/tests/table_script/mathematical_operations_tests.rs @@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script; // Fi use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_definition::ColumnDefinition; use rstest::*; -use serde_json::json; use sqlx::PgPool; /// Helper function to create a test table with specified columns diff --git a/server/tests/table_script/post_scripts_integration_tests.rs b/server/tests/table_script/post_scripts_integration_tests.rs index 0074f9f..8efa579 100644 --- a/server/tests/table_script/post_scripts_integration_tests.rs +++ b/server/tests/table_script/post_scripts_integration_tests.rs @@ -4,7 +4,6 @@ use crate::common::setup_isolated_db; use server::table_script::handlers::post_table_script::post_table_script; use common::proto::komp_ac::table_script::{PostTableScriptRequest, TableScriptResponse}; use common::proto::komp_ac::table_definition::ColumnDefinition; -use serde_json::json; use sqlx::PgPool; /// Test utilities for table script integration testing - moved to top level for shared access diff --git a/server/tests/table_script/prohibited_types_test.rs b/server/tests/table_script/prohibited_types_test.rs index c5ef322..6d77728 100644 --- a/server/tests/table_script/prohibited_types_test.rs +++ b/server/tests/table_script/prohibited_types_test.rs @@ -4,7 +4,6 @@ use crate::common::setup_isolated_db; use server::table_script::handlers::post_table_script::post_table_script; use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_definition::ColumnDefinition; -use serde_json::json; use sqlx::PgPool; /// Helper function to create a test table with specified columns diff --git a/server/tests/table_script/type_safety_comprehensive_tests.rs b/server/tests/table_script/type_safety_comprehensive_tests.rs index aedf049..7a5b2f7 100644 --- a/server/tests/table_script/type_safety_comprehensive_tests.rs +++ b/server/tests/table_script/type_safety_comprehensive_tests.rs @@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script; use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_definition::ColumnDefinition; use rstest::*; -use serde_json::json; use sqlx::PgPool; /// Test fixture for allowed mathematical types diff --git a/server/tests/tables_data/delete/delete_table_data_test.rs b/server/tests/tables_data/delete/delete_table_data_test.rs index 4e0e86b..d8e51e8 100644 --- a/server/tests/tables_data/delete/delete_table_data_test.rs +++ b/server/tests/tables_data/delete/delete_table_data_test.rs @@ -5,7 +5,6 @@ use sqlx::{PgPool, Row}; use std::collections::HashMap; use std::sync::Arc; use tokio::sync::{mpsc, Mutex}; -use serde_json::json; use chrono::Utc; use futures::future::join_all; use prost_types::{value::Kind, Value}; @@ -17,7 +16,7 @@ use common::proto::komp_ac::table_definition::{ PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink, }; use common::proto::komp_ac::tables_data::{ - DeleteTableDataRequest, DeleteTableDataResponse, PostTableDataRequest, PutTableDataRequest, + DeleteTableDataRequest, PostTableDataRequest, PutTableDataRequest, }; use server::indexer::IndexCommand; use server::table_definition::handlers::post_table_definition; diff --git a/server/tests/tables_data/get/get_table_data_by_position_test.rs b/server/tests/tables_data/get/get_table_data_by_position_test.rs index 15494f7..2a0b4df 100644 --- a/server/tests/tables_data/get/get_table_data_by_position_test.rs +++ b/server/tests/tables_data/get/get_table_data_by_position_test.rs @@ -8,7 +8,6 @@ use server::table_definition::handlers::post_table_definition; use server::tables_data::handlers::get_table_data_by_position; use crate::common::setup_test_db; use chrono::Utc; -use serde_json::json; #[fixture] async fn pool() -> PgPool { diff --git a/server/tests/tables_data/get/get_table_data_test.rs b/server/tests/tables_data/get/get_table_data_test.rs index ab2fba4..bf143f1 100644 --- a/server/tests/tables_data/get/get_table_data_test.rs +++ b/server/tests/tables_data/get/get_table_data_test.rs @@ -5,14 +5,12 @@ use common::proto::komp_ac::tables_data::GetTableDataRequest; use crate::common::setup_test_db; use sqlx::{PgPool, Row}; use tonic; -use chrono::{DateTime, Utc}; +use chrono::Utc; use serde_json::json; use std::collections::HashMap; use futures::future::join_all; use rand::distr::Alphanumeric; use rand::Rng; -use rust_decimal::Decimal; -use rust_decimal_macros::dec; use server::table_definition::handlers::post_table_definition; use server::tables_data::handlers::post_table_data; use common::proto::komp_ac::table_definition::{ @@ -22,7 +20,6 @@ use common::proto::komp_ac::tables_data::PostTableDataRequest; use prost_types::Value; use prost_types::value::Kind; use tokio::sync::mpsc; -use server::indexer::IndexCommand; #[fixture] async fn pool() -> PgPool { diff --git a/server/tests/tables_data/get/get_table_data_test2.rs b/server/tests/tables_data/get/get_table_data_test2.rs index 5dfe35e..b1dab83 100644 --- a/server/tests/tables_data/get/get_table_data_test2.rs +++ b/server/tests/tables_data/get/get_table_data_test2.rs @@ -795,7 +795,7 @@ async fn test_retrieve_from_nonexistent_schema() { #[rstest] #[tokio::test] async fn test_retrieve_with_database_connection_error() { - let mut closed_pool = setup_test_db().await; + let closed_pool = setup_test_db().await; closed_pool.close().await; let request = GetTableDataRequest { diff --git a/server/tests/tables_data/post/post_table_data_test.rs b/server/tests/tables_data/post/post_table_data_test.rs index e8ef37d..ec3ba32 100644 --- a/server/tests/tables_data/post/post_table_data_test.rs +++ b/server/tests/tables_data/post/post_table_data_test.rs @@ -20,7 +20,6 @@ use server::indexer::IndexCommand; use sqlx::Row; use rand::distr::Alphanumeric; use rand::Rng; -use rust_decimal::prelude::FromPrimitive; // Helper function to generate unique identifiers for test isolation fn generate_unique_id() -> String { @@ -154,7 +153,7 @@ async fn test_context() -> TestContext { #[fixture] async fn closed_test_context() -> TestContext { - let mut context = test_context().await; + let context = test_context().await; context.pool.close().await; context } diff --git a/server/tests/tables_data/put/put_table_data_test2.rs b/server/tests/tables_data/put/put_table_data_test2.rs index c96fdb3..d0167d0 100644 --- a/server/tests/tables_data/put/put_table_data_test2.rs +++ b/server/tests/tables_data/put/put_table_data_test2.rs @@ -5,7 +5,7 @@ // ======================================================================== // Additional imports needed for these tests -use chrono::{DateTime, Utc}; +use chrono::Utc; use rust_decimal::Decimal; use std::str::FromStr; diff --git a/server/tests/tables_data/put/put_table_data_test5.rs b/server/tests/tables_data/put/put_table_data_test5.rs index 639b126..485c9d1 100644 --- a/server/tests/tables_data/put/put_table_data_test5.rs +++ b/server/tests/tables_data/put/put_table_data_test5.rs @@ -8,7 +8,7 @@ // This is needed for the database error test. #[fixture] async fn closed_test_context() -> TestContext { - let mut context = test_context().await; + let context = test_context().await; context.pool.close().await; context }