dotenv-rs / dotenv

Library to help supply environment variables in testing and development
MIT License
557 stars 85 forks source link

env::var vs dotenv::var #65

Closed DusterTheFirst closed 3 years ago

DusterTheFirst commented 3 years ago

What is the purpose of dotenv::var and dotenv::vars and how do they compare to their std::env equivalents

DusterTheFirst commented 3 years ago

upon looking into the code, it just calls std::env::var after first initializing dotenv. This should be made clearer in the documentation

ZoeyR commented 3 years ago

The documentation for dotenv::var starts with the line "After loading the dotenv file, fetches the environment variable key from the current process. Is there anything that would make it clearer that it loads the file first and then fetches the variables?

DusterTheFirst commented 3 years ago

I guess I misunderstood the "After loading the dotenv file" to mean that this function must be called after dotenv::dotenv