Skip to content

Commit

Permalink
fix: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kukkok3 committed Oct 3, 2023
1 parent 5547ed9 commit ccf68b9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ impl fmt::Display for LogLevel {
}
}



pub fn load_settings_from_file(file_path: &str) -> Result<ServiceSettings, impl std::error::Error> {
let f = fs::File::open(file_path)?;
serde_json::from_reader(&f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pub mod cli;
pub mod data;
#[cfg(feature = "non-functional")]
pub mod non_functional;
pub mod rest;
pub mod rest;

0 comments on commit ccf68b9

Please sign in to comment.