Skip to content

Commit 17377e0

Browse files
committed
chore: commit formatting
1 parent 2af0966 commit 17377e0

File tree

10 files changed

+35
-38
lines changed

10 files changed

+35
-38
lines changed

src/configuration.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::domain::SubscriberEmail;
2-
use crate::email_client::EmailClient;
1+
use crate::{domain::SubscriberEmail, email_client::EmailClient};
32
use secrecy::{ExposeSecret, Secret};
43
use serde_aux::field_attributes::deserialize_number_from_string;
54
use sqlx::postgres::{PgConnectOptions, PgSslMode};

src/issue_delivery_worker.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::domain::SubscriberEmail;
2-
use crate::email_client::EmailClient;
3-
use crate::{configuration::Settings, startup::get_connection_pool};
1+
use crate::{
2+
configuration::Settings, domain::SubscriberEmail, email_client::EmailClient,
3+
startup::get_connection_pool,
4+
};
45
use sqlx::{PgPool, Postgres, Transaction};
56
use std::time::Duration;
67
use tracing::{field::display, Span};

src/routes/admin/dashboard.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
use crate::session_state::TypedSession;
2-
use crate::utils::e500;
3-
use actix_web::http::header::ContentType;
4-
use actix_web::{web, HttpResponse};
1+
use crate::{session_state::TypedSession, utils::e500};
2+
use actix_web::{http::header::ContentType, web, HttpResponse};
53
use anyhow::Context;
64
use sqlx::PgPool;
75
use uuid::Uuid;
8-
// Return an opaque 500 while preserving the error's root cause for logging.
96

107
pub async fn admin_dashboard(
118
session: TypedSession,

src/routes/admin/logout.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use crate::session_state::TypedSession;
2-
use crate::utils::{e500, see_other};
1+
use crate::{
2+
session_state::TypedSession,
3+
utils::{e500, see_other},
4+
};
35
use actix_web::HttpResponse;
46
use actix_web_flash_messages::FlashMessage;
57

src/routes/admin/newsletters/get.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use actix_web::http::header::ContentType;
2-
use actix_web::HttpResponse;
1+
use actix_web::{http::header::ContentType, HttpResponse};
32
use actix_web_flash_messages::IncomingFlashMessages;
43
use std::fmt::Write;
54

src/routes/admin/newsletters/post.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use crate::authentication::UserId;
2-
use crate::idempotency::IdempotencyKey;
3-
use crate::idempotency::{get_saved_response, save_response, try_processing, NextAction};
4-
use crate::utils::{e400, e500, see_other};
5-
use actix_web::web::ReqData;
6-
use actix_web::{web, HttpResponse};
1+
use crate::{
2+
authentication::UserId,
3+
idempotency::{get_saved_response, save_response, try_processing, IdempotencyKey, NextAction},
4+
utils::{e400, e500, see_other},
5+
};
6+
use actix_web::{web, web::ReqData, HttpResponse};
77
use actix_web_flash_messages::FlashMessage;
88
use anyhow::Context;
99
use sqlx::{PgPool, Postgres, Transaction};

src/routes/admin/password/get.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::session_state::TypedSession;
2-
use crate::utils::{e500, see_other};
3-
use actix_web::http::header::ContentType;
4-
use actix_web::HttpResponse;
1+
use crate::{
2+
session_state::TypedSession,
3+
utils::{e500, see_other},
4+
};
5+
use actix_web::{http::header::ContentType, HttpResponse};
56
use actix_web_flash_messages::IncomingFlashMessages;
67
use std::fmt::Write;
78

src/routes/admin/password/post.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::authentication::UserId;
2-
use crate::authentication::{validate_credentials, AuthError, Credentials};
3-
use crate::routes::admin::dashboard::get_username;
4-
use crate::utils::{e500, see_other};
1+
use crate::{
2+
authentication::{validate_credentials, AuthError, Credentials, UserId},
3+
routes::admin::dashboard::get_username,
4+
utils::{e500, see_other},
5+
};
56
use actix_web::{web, HttpResponse};
67
use actix_web_flash_messages::FlashMessage;
78
use secrecy::{ExposeSecret, Secret};

src/routes/login/post.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use crate::authentication::AuthError;
2-
use crate::authentication::{validate_credentials, Credentials};
3-
use crate::routes::error_chain_fmt;
4-
use crate::session_state::TypedSession;
5-
use actix_web::error::InternalError;
6-
use actix_web::http::header::LOCATION;
7-
use actix_web::web;
8-
use actix_web::HttpResponse;
1+
use crate::{
2+
authentication::{validate_credentials, AuthError, Credentials},
3+
routes::error_chain_fmt,
4+
session_state::TypedSession,
5+
};
6+
use actix_web::{error::InternalError, http::header::LOCATION, web, HttpResponse};
97
use actix_web_flash_messages::FlashMessage;
108
use secrecy::Secret;
119
use sqlx::PgPool;

src/session_state.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use actix_session::{Session, SessionExt, SessionGetError, SessionInsertError};
2-
use actix_web::dev::Payload;
3-
use actix_web::{FromRequest, HttpRequest};
2+
use actix_web::{dev::Payload, FromRequest, HttpRequest};
43
use std::future::{ready, Ready};
54
use uuid::Uuid;
65

0 commit comments

Comments
 (0)