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