From e2c32161a9ae85099b8c8387d086195b61b4f818 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 29 Oct 2023 01:18:40 +0100 Subject: [PATCH] update dotenv::dotenv references --- .vscode/settings.json | 1 + auth/simple-auth-server/src/main.rs | 2 +- background-jobs/src/main.rs | 2 +- basics/todo/src/main.rs | 2 +- databases/diesel/src/main.rs | 4 ++-- databases/mysql/src/main.rs | 2 +- databases/postgres/src/main.rs | 2 +- forms/multipart-s3/src/main.rs | 2 +- graphql/juniper-advanced/src/main.rs | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f93bf52..94a2914 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "autoreload", "chrono", "dotenv", + "dotenvy", "graphiql", "minijinja", "nocapture", diff --git a/auth/simple-auth-server/src/main.rs b/auth/simple-auth-server/src/main.rs index 6f6a8a9..286da40 100644 --- a/auth/simple-auth-server/src/main.rs +++ b/auth/simple-auth-server/src/main.rs @@ -18,7 +18,7 @@ mod utils; #[actix_web::main] async fn main() -> std::io::Result<()> { - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set"); diff --git a/background-jobs/src/main.rs b/background-jobs/src/main.rs index c49fe03..88e59a6 100644 --- a/background-jobs/src/main.rs +++ b/background-jobs/src/main.rs @@ -15,7 +15,7 @@ pub(crate) type ItemCache = Mutex>>; #[tokio::main] async fn main() -> anyhow::Result<()> { - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); // background jobs relating to local, disposable tasks diff --git a/basics/todo/src/main.rs b/basics/todo/src/main.rs index 938f194..8965b46 100644 --- a/basics/todo/src/main.rs +++ b/basics/todo/src/main.rs @@ -7,7 +7,7 @@ use actix_web::{ middleware::{ErrorHandlers, Logger}, web, App, HttpServer, }; -use dotenv::dotenv; +use dotenvy::dotenv; use tera::Tera; mod api; diff --git a/databases/diesel/src/main.rs b/databases/diesel/src/main.rs index 1cfe58a..475753b 100644 --- a/databases/diesel/src/main.rs +++ b/databases/diesel/src/main.rs @@ -76,7 +76,7 @@ async fn add_user( #[actix_web::main] async fn main() -> std::io::Result<()> { - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); // initialize DB pool outside of `HttpServer::new` so that it is shared across all workers @@ -118,7 +118,7 @@ mod tests { #[actix_web::test] async fn user_routes() { - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); env_logger::try_init_from_env(env_logger::Env::new().default_filter_or("info")).ok(); let pool = initialize_db_pool(); diff --git a/databases/mysql/src/main.rs b/databases/mysql/src/main.rs index 6210582..dad1d10 100644 --- a/databases/mysql/src/main.rs +++ b/databases/mysql/src/main.rs @@ -24,7 +24,7 @@ fn get_conn_builder( #[actix_web::main] async fn main() -> io::Result<()> { // initialize environment - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); // initialize logger env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); diff --git a/databases/postgres/src/main.rs b/databases/postgres/src/main.rs index b80dbe2..de0b334 100644 --- a/databases/postgres/src/main.rs +++ b/databases/postgres/src/main.rs @@ -125,7 +125,7 @@ mod handlers { use ::config::Config; use actix_web::{web, App, HttpServer}; -use dotenv::dotenv; +use dotenvy::dotenv; use handlers::{add_user, get_users}; use tokio_postgres::NoTls; diff --git a/forms/multipart-s3/src/main.rs b/forms/multipart-s3/src/main.rs index 626cf93..0f471f9 100644 --- a/forms/multipart-s3/src/main.rs +++ b/forms/multipart-s3/src/main.rs @@ -7,7 +7,7 @@ use actix_web::{ }; use actix_web_lab::{extract::Path, respond::Html}; use aws_config::meta::region::RegionProviderChain; -use dotenv::dotenv; +use dotenvy::dotenv; use serde_json::json; mod client; diff --git a/graphql/juniper-advanced/src/main.rs b/graphql/juniper-advanced/src/main.rs index af99bec..21b3be1 100644 --- a/graphql/juniper-advanced/src/main.rs +++ b/graphql/juniper-advanced/src/main.rs @@ -9,7 +9,7 @@ use self::{db::get_db_pool, handlers::register}; #[actix_web::main] async fn main() -> std::io::Result<()> { - dotenv::dotenv().ok(); + dotenvy::dotenv().ok(); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); let pool = get_db_pool();