diff --git a/src/app/interfaces/authentication.rs b/src/app/interfaces/authentication.rs index 459ea548..fab1436e 100644 --- a/src/app/interfaces/authentication.rs +++ b/src/app/interfaces/authentication.rs @@ -2,8 +2,7 @@ use http::header; use tonic::{Request, Status}; use tracing::error; -use crate::app::context::AppContext; -use crate::app::RequestContext; +use crate::app::{context::AppContext, RequestContext}; pub fn authentication(req: Request<()>) -> Result, Status> { let app_ctx = req.extensions().get::().unwrap().clone(); diff --git a/src/app/interfaces/middleware.rs b/src/app/interfaces/middleware.rs index 9ead934f..df28f25a 100644 --- a/src/app/interfaces/middleware.rs +++ b/src/app/interfaces/middleware.rs @@ -1,7 +1,6 @@ use std::pin::Pin; -use hyper::service::Service; -use hyper::Body; +use hyper::{service::Service, Body}; use tonic::body::BoxBody; use tower::Layer; diff --git a/src/features/app/infrastructure.rs b/src/features/app/infrastructure.rs index 41834750..76c74dff 100644 --- a/src/features/app/infrastructure.rs +++ b/src/features/app/infrastructure.rs @@ -1,8 +1,9 @@ -use crate::{app::AppContext, features::common::entities::VoteSummary}; +use crate::{ + app::AppContext, + features::{app::errors::AppError, common::entities::VoteSummary}, +}; use tracing::error; -use super::errors::AppError; - pub(crate) async fn get_votes_by_snap_id( app_ctx: &AppContext, snap_id: &str, diff --git a/src/features/app/interface.rs b/src/features/app/interface.rs index cb4da56c..2c568f1d 100644 --- a/src/features/app/interface.rs +++ b/src/features/app/interface.rs @@ -1,12 +1,11 @@ use crate::app::AppContext; -use crate::features::pb::app::{GetRatingRequest, GetRatingResponse}; +use crate::features::{ + app::{service::AppService, use_cases}, + pb::app::{app_server::App, GetRatingRequest, GetRatingResponse}, +}; use tonic::{Request, Response, Status}; -use crate::features::pb::app::app_server::App; - -use super::{service::AppService, use_cases}; - #[tonic::async_trait] impl App for AppService { #[tracing::instrument] diff --git a/src/features/chart/entities.rs b/src/features/chart/entities.rs index 7bb9d345..12a4c5bd 100644 --- a/src/features/chart/entities.rs +++ b/src/features/chart/entities.rs @@ -1,8 +1,9 @@ +use crate::features::{ + common::entities::{calculate_band, Rating, VoteSummary}, + pb::chart as pb, +}; use sqlx::FromRow; -use crate::features::common::entities::{calculate_band, Rating, VoteSummary}; -use crate::features::pb::chart as pb; - pub struct Chart { pub timeframe: pb::Timeframe, pub chart_data: Vec, diff --git a/src/features/chart/infrastructure.rs b/src/features/chart/infrastructure.rs index 6bd4988a..4ed0f07b 100644 --- a/src/features/chart/infrastructure.rs +++ b/src/features/chart/infrastructure.rs @@ -1,10 +1,9 @@ -use crate::app::AppContext; -use crate::features::common::entities::VoteSummary; -use crate::features::pb::chart::Timeframe; +use crate::{ + app::AppContext, + features::{chart::errors::ChartError, common::entities::VoteSummary, pb::chart::Timeframe}, +}; use tracing::error; -use super::errors::ChartError; - pub(crate) async fn get_votes_summary_by_timeframe( app_ctx: &AppContext, timeframe: Timeframe, diff --git a/src/features/chart/interface.rs b/src/features/chart/interface.rs index fbbf2af9..61b5ddf1 100644 --- a/src/features/chart/interface.rs +++ b/src/features/chart/interface.rs @@ -1,13 +1,12 @@ -use crate::app::AppContext; - -use crate::features::pb::chart::{GetChartRequest, GetChartResponse, Timeframe}; +use crate::{ + app::AppContext, + features::{ + chart::{errors::ChartError, service::ChartService, use_cases}, + pb::chart::{chart_server::Chart, GetChartRequest, GetChartResponse, Timeframe}, + }, +}; use tonic::{Request, Response, Status}; -use crate::features::pb::chart::chart_server::Chart; - -use super::errors::ChartError; -use super::{service::ChartService, use_cases}; - #[tonic::async_trait] impl Chart for ChartService { #[tracing::instrument] diff --git a/src/features/chart/use_cases.rs b/src/features/chart/use_cases.rs index 4358ffd3..54daaa9c 100644 --- a/src/features/chart/use_cases.rs +++ b/src/features/chart/use_cases.rs @@ -1,9 +1,9 @@ use super::{errors::ChartError, infrastructure::get_votes_summary_by_timeframe}; -use crate::app::AppContext; -use crate::features::chart::entities::Chart; -use crate::features::pb::chart::Timeframe; +use crate::{ + app::AppContext, + features::{chart::entities::Chart, pb::chart::Timeframe}, +}; use tracing::error; -// use super::{entities::Rating, errors::AppError, infrastructure::get_votes_by_snap_id}; pub async fn get_chart(app_ctx: &AppContext, timeframe: Timeframe) -> Result { let votes = get_votes_summary_by_timeframe(app_ctx, timeframe)