Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Mar 28, 2024
1 parent 495c9ac commit 83657ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ mod infra_repository_impls {
}

mod presentation {
use crate::config::CONFIG;
use crate::domain::{BuildHandler, BuildRepository};
use axum::extract::State;
use axum::http::StatusCode;
use axum::response::{ErrorResponse, IntoResponse, Response, Result};
use axum::Json;
use axum_extra::headers::Authorization;
use axum_extra::headers::authorization::Bearer;
use axum_extra::headers::Authorization;
use axum_extra::TypedHeader;
use serde_json::json;
use tokio_util::io::ReaderStream;
use crate::config::CONFIG;

#[tracing::instrument]
pub async fn get_stable_build_handler(
Expand Down Expand Up @@ -193,10 +193,10 @@ mod presentation {
#[tracing::instrument]
pub async fn publish_stable_build_handler(
State(repository): State<BuildRepository>,
TypedHeader(auth): TypedHeader<Authorization<Bearer>>
TypedHeader(auth): TypedHeader<Authorization<Bearer>>,
) -> Result<impl IntoResponse> {
if auth.token().to_string() != CONFIG.token {
return Err(ErrorResponse::from(StatusCode::FORBIDDEN.into_response()))
return Err(ErrorResponse::from(StatusCode::FORBIDDEN.into_response()));
}

match repository.run_stable_build().await {
Expand All @@ -213,14 +213,14 @@ mod presentation {
#[tracing::instrument]
pub async fn publish_develop_build_handler(
State(repository): State<BuildRepository>,
TypedHeader(auth): TypedHeader<Authorization<Bearer>>
TypedHeader(auth): TypedHeader<Authorization<Bearer>>,
) -> Result<impl IntoResponse> {
if auth.token().to_string() != CONFIG.token {
return Err(ErrorResponse::from(StatusCode::FORBIDDEN.into_response()))
return Err(ErrorResponse::from(StatusCode::FORBIDDEN.into_response()));
}

match repository.run_develop_build().await {
Ok(_) => Ok(StatusCode::OK.into_response()),
Ok(_) => Ok(StatusCode::OK.into_response()),
Err(err) => {
tracing::error!("{:}", err);
Err(ErrorResponse::from(
Expand Down

0 comments on commit 83657ff

Please sign in to comment.