From dbe4dc67cb1baa5ae5c5f2b452ff45d388c719ea Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sun, 1 Jun 2025 01:26:37 +0000 Subject: [PATCH] DBURL name change (#7) Reviewed-on: https://git.kundeng.us/phoenix/icarus_envy/pulls/7 Co-authored-by: kdeng00 Co-committed-by: kdeng00 --- Cargo.toml | 2 +- src/environment.rs | 2 +- src/keys.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b4b49b0..ca6936c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_envy" -version = "0.1.0" +version = "0.2.0" edition = "2024" rust-version = "1.86" diff --git a/src/environment.rs b/src/environment.rs index e4051f9..33a13df 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -1,7 +1,7 @@ pub async fn get_db_url() -> String { dotenvy::dotenv().ok(); - std::env::var(crate::keys::DBURL).expect(crate::keys::error::ERROR) + std::env::var(crate::keys::DB_URL).expect(crate::keys::error::DB_URL) } pub async fn get_secret_main_key() -> String { diff --git a/src/keys.rs b/src/keys.rs index b320fc0..57acf26 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -1,6 +1,5 @@ -// TODO: Change this to snake case // Environment key for Database management -pub const DBURL: &str = "DATABASE_URL"; +pub const DB_URL: &str = "DATABASE_URL"; // Environment key for secret main key // Used for the icarus app @@ -14,7 +13,7 @@ pub const SECRET_KEY: &str = "SECRET_KEY"; pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY"; pub mod error { - pub const ERROR: &str = "DATABASE_URL must be set in .env"; + pub const DB_URL: &str = "DATABASE_URL must be set in .env"; pub const SECRET_KEY: &str = "SECRET_KEY must be set in environment file"; pub const SECRET_MAIN_KEY: &str = "SECRET_MAIN_KEY must not be set in environment file"; pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY must not be set in environment file";