From ccf68b9ad5b3a4f65777ad7be6a66c01798cbfb8 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:56:19 +0200 Subject: [PATCH] fix: cargo fmt --- .../src/server/settings/config.rs | 2 -- .../src/v0/endpoints/mod.rs | 1 - .../vit-servicing-station-lib-f10/src/v0/mod.rs | 15 +++++---------- .../vit-servicing-station-server-f10/src/main.rs | 6 +----- .../src/common/data/csv_converter.rs | 4 +++- .../common/data/generator/arbitrary/generator.rs | 4 +++- .../src/tests/mod.rs | 2 +- 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/server/settings/config.rs b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/server/settings/config.rs index 39fb0d8b77..c83bc5dfb2 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/server/settings/config.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/server/settings/config.rs @@ -326,8 +326,6 @@ impl fmt::Display for LogLevel { } } - - pub fn load_settings_from_file(file_path: &str) -> Result { let f = fs::File::open(file_path)?; serde_json::from_reader(&f) diff --git a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/endpoints/mod.rs b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/endpoints/mod.rs index 0565f8b184..d27052b270 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/endpoints/mod.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/endpoints/mod.rs @@ -46,7 +46,6 @@ pub async fn filter( let fund_filter = warp::path!("fund" / ..).and(funds::admin_filter(context.clone())); base.and(fund_filter) - }; let api_token_filter = if enable_api_tokens { diff --git a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/mod.rs b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/mod.rs index 7aac6d695f..56dc014f58 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/mod.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/v0/mod.rs @@ -32,24 +32,19 @@ pub async fn filter( parent_span_id = Empty, ); if let Some(remote_addr) = info.remote_addr() { - span.record("remote_addr", &remote_addr.to_string().as_str()); + span.record("remote_addr", remote_addr.to_string().as_str()); } if let Some(trace_context) = get_trace_context(info.request_headers()) { - span.record("trace_id", &trace_context.trace_id().to_string().as_str()); - span.record("span_id", &trace_context.span_id().to_string().as_str()); + span.record("trace_id", trace_context.trace_id().to_string().as_str()); + span.record("span_id", trace_context.span_id().to_string().as_str()); if let Some(parent_span_id) = trace_context.parent_id() { - span.record("parent_span_id", &parent_span_id.to_string().as_str()); + span.record("parent_span_id", parent_span_id.to_string().as_str()); } } span }); - let v0 = endpoints::filter( - v0_root.boxed(), - ctx.clone(), - enable_api_tokens, - ) - .await; + let v0 = endpoints::filter(v0_root.boxed(), ctx.clone(), enable_api_tokens).await; let service_version = endpoints::service_version::filter(service_version_root.boxed(), ctx).await; diff --git a/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs b/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs index 92c1241325..93db97bc55 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs @@ -117,11 +117,7 @@ async fn main() { let context = v0::context::new_shared_context(db_pool, &settings.block0_path, &settings.service_version); - let app = v0::filter( - context, - settings.enable_api_tokens, - ) - .await; + let app = v0::filter(context, settings.enable_api_tokens).await; info!( "Running server at {}, database located at {}", diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/csv_converter.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/csv_converter.rs index 385c91236f..8e1cfe471b 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/csv_converter.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/csv_converter.rs @@ -4,7 +4,9 @@ use thiserror::Error; use time::format_description::well_known::Rfc3339; use vit_servicing_station_lib_f10::db::models::community_advisors_reviews::AdvisorReview; use vit_servicing_station_lib_f10::db::models::goals::InsertGoal; -use vit_servicing_station_lib_f10::db::models::proposals::{FullProposalInfo, ProposalChallengeInfo}; +use vit_servicing_station_lib_f10::db::models::proposals::{ + FullProposalInfo, ProposalChallengeInfo, +}; use vit_servicing_station_lib_f10::{ db::models::{challenges::Challenge, funds::Fund, voteplans::Voteplan}, utils::datetime::unix_timestamp_to_datetime, diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/arbitrary/generator.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/arbitrary/generator.rs index 45d183cc20..ea3f519501 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/arbitrary/generator.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/arbitrary/generator.rs @@ -7,7 +7,9 @@ use fake::Fake; use rand::{rngs::OsRng, RngCore}; use std::{collections::HashMap, iter}; use time::{Duration, OffsetDateTime}; -use vit_servicing_station_lib_f10::{db::models::api_tokens::ApiTokenData, v0::api_token::ApiToken}; +use vit_servicing_station_lib_f10::{ + db::models::api_tokens::ApiTokenData, v0::api_token::ApiToken, +}; #[derive(Clone)] pub struct ArbitraryGenerator { diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs index 64decdd945..b86078b4dc 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs @@ -3,4 +3,4 @@ pub mod cli; pub mod data; #[cfg(feature = "non-functional")] pub mod non_functional; -pub mod rest; \ No newline at end of file +pub mod rest;