diff --git a/src/main.rs b/src/main.rs index 615167b..c5e3b50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ use crate::templates::shift_reports_html; include!(concat!(env!("OUT_DIR"), "/templates.rs")); -async fn establish_connection() -> Pool { +fn establish_connection() -> Pool { dotenv().ok(); let database_url = std::env::var("DATABASE_URL").expect("You must set DATABASE_URL"); @@ -47,14 +47,13 @@ async fn establish_connection() -> Pool { #[derive(Clone)] pub(crate) struct AppState { - #[allow(dead_code)] connection: Pool, } impl AppState { - async fn init() -> Self { + fn init() -> Self { Self { - connection: establish_connection().await, + connection: establish_connection(), } } } @@ -70,7 +69,7 @@ async fn main() { .with(tracing_subscriber::fmt::layer()) .init(); - let state = AppState::init().await; + let state = AppState::init(); let fallback_handler = ServeDir::new("dist").not_found_service(ServeFile::new("dist/404.html"));