Fix clippy errors

This commit is contained in:
Luca Palmieri 2021-12-28 17:47:16 +01:00
parent 6ee13add72
commit 67247e070f
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ async fn main() -> std::io::Result<()> {
let configuration = get_configuration().expect("Failed to read configuration."); let configuration = get_configuration().expect("Failed to read configuration.");
let connection_pool = let connection_pool =
PgPool::connect(&configuration.database.connection_string().expose_secret()) PgPool::connect(configuration.database.connection_string().expose_secret())
.await .await
.expect("Failed to connect to Postgres."); .expect("Failed to connect to Postgres.");

View file

@ -50,7 +50,7 @@ async fn spawn_app() -> TestApp {
pub async fn configure_database(config: &DatabaseSettings) -> PgPool { pub async fn configure_database(config: &DatabaseSettings) -> PgPool {
// Create database // Create database
let mut connection = let mut connection =
PgConnection::connect(&config.connection_string_without_db().expose_secret()) PgConnection::connect(config.connection_string_without_db().expose_secret())
.await .await
.expect("Failed to connect to Postgres"); .expect("Failed to connect to Postgres");
connection connection
@ -59,7 +59,7 @@ pub async fn configure_database(config: &DatabaseSettings) -> PgPool {
.expect("Failed to create database."); .expect("Failed to create database.");
// Migrate database // Migrate database
let connection_pool = PgPool::connect(&config.connection_string().expose_secret()) let connection_pool = PgPool::connect(config.connection_string().expose_secret())
.await .await
.expect("Failed to connect to Postgres."); .expect("Failed to connect to Postgres.");
sqlx::migrate!("./migrations") sqlx::migrate!("./migrations")