From e75c62bab5344e21d33e6c751da3925c95bb5ad6 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Mon, 12 Feb 2024 09:54:06 +1100 Subject: [PATCH] reorganise --- src/main.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2853325..83227f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,22 @@ use rocket::{ #[macro_use] extern crate rocket; +#[launch] +fn rocket() -> _ { + env_logger::builder() + .format_module_path(false) + .format_timestamp( + if std::env::var("LOG_TIMESTAMP").is_ok_and(|v| v == "false") { + None + } else { + Some(env_logger::TimestampPrecision::Seconds) + }, + ) + .init(); + + rocket::build().mount("/", routes![authenticated, deauthenticated, login]) +} + struct Secrets { client_id: String, client_secret: String, @@ -122,22 +138,6 @@ fn login() -> RedirOrStatic { ).into()) } -#[launch] -fn rocket() -> _ { - env_logger::builder() - .format_module_path(false) - .format_timestamp( - if std::env::var("LOG_TIMESTAMP").is_ok_and(|v| v == "false") { - None - } else { - Some(env_logger::TimestampPrecision::Seconds) - }, - ) - .init(); - - rocket::build().mount("/", routes![authenticated, deauthenticated, login]) -} - enum RedirOrStatic { Redirect(Box), Static(String),