Crates.io | load-dotenv |
lib.rs | load-dotenv |
version | 0.1.2 |
source | src |
created_at | 2019-02-15 14:39:10.044024 |
updated_at | 2021-01-04 11:13:17.814442 |
description | This is a small procedural macro to load your .env file at compile time |
homepage | https://github.com/davidpdrsn/load-dotenv |
repository | https://github.com/davidpdrsn/load-dotenv.git |
max_upload_size | |
id | 114974 |
size | 3,448 |
This is a small procedural macro to load your .env
file at compile time. That way you can use
std::env!
to load environment variables and fail the build if a variable is missing.
All it does is call the dotenv crate.
.env
file:
KEY=value
Rust:
use load_dotenv::load_dotenv;
load_dotenv!();
fn main() {
assert_eq!("value", env!("KEY"));
}
License: MIT