allan2 / dotenvy

A well-maintained fork of the Rust dotenv crate
MIT License
625 stars 39 forks source link

feat: simplified `dotenv!` usage and added `dotenv_override!` macro #107

Open sabify opened 3 weeks ago

sabify commented 3 weeks ago

The dotenvy_macro::dotenv! macro only needs to populate the variables once and then the variables are accessible via Rust's env! macro. This is much more natural, clean and ergonomic. With the current implementation, the macro reads the .env file and populates the variables on each call and then tries to come to a resolution.

This PR also adds the dotenv_override! macro in line with the main library.