From 6741ed9e14e5623f3a61dc99350265700647672f Mon Sep 17 00:00:00 2001 From: Nick Bland Date: Tue, 16 Nov 2021 20:55:54 +1000 Subject: [PATCH] Final fixes for docker optimisation Also fixed up error of forgetting to include an await in the main function --- Cargo.toml | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b5cf922..0230fe0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "mail_app" version = "0.1.0" authors = ["Nick Bland"] -edition = "2021" +edition = "2018" [lib] path = "src/lib.rs" diff --git a/src/main.rs b/src/main.rs index f672be1..2716a87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ use std::net::TcpListener; -use sqlx::PgPool; use sqlx::postgres::PgPoolOptions; use mail_app::startup::run; @@ -18,6 +17,7 @@ async fn main() -> std::io::Result<()> { let connection_pool = PgPoolOptions::new() .connect_timeout(std::time::Duration::from_secs(2)) .connect(&configuration.database.connection_string()) + .await .expect("Failed to connect to Postgres."); // Take port from settings file