diff --git a/Cargo.lock b/Cargo.lock index a3d6026..b5f81be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,14 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "git+https://github.com/allan2/dotenvy.git#e2da110668572cf2d67178f192eb1fc285224040" + [[package]] name = "dotenvy-practice" version = "0.1.0" +dependencies = [ + "dotenvy", +] diff --git a/Cargo.toml b/Cargo.toml index e0489ba..bc72183 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] +dotenvy = { git = "https://github.com/allan2/dotenvy.git", version = "0.15.7" } diff --git a/src/main.rs b/src/main.rs index e7a11a9..61d9738 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,9 @@ +use dotenvy::{EnvLoader, EnvSequence}; + fn main() { + EnvLoader::new().sequence(EnvSequence::EnvOnly).load().unwrap(); // Not panics + EnvLoader::new().sequence(EnvSequence::EnvThenInput).load().unwrap(); // Panics + EnvLoader::new().sequence(EnvSequence::InputThenEnv).load().unwrap(); // Panics + EnvLoader::new().sequence(EnvSequence::InputOnly).load().unwrap(); // Panics println!("Hello, world!"); }