Crates.io | env-smart |
lib.rs | env-smart |
version | 1.0.1 |
source | src |
created_at | 2023-10-23 04:17:27.970903 |
updated_at | 2024-01-11 02:52:00.168446 |
description | Proc macro to insert env vars into code |
homepage | |
repository | https://github.com/DoumanAsh/env-smart |
max_upload_size | |
id | 1010941 |
size | 11,767 |
Improved version of env!
macro from std.
env!
- If plain string specified then behavior is the same as standard env macro{}
brackets. Note that bracket escaping is not supportedMacro fetches environment variables in following order:
.env
file from root where build is run. Duplicate values are not allowed..env
variablesuse env_smart::env;
static USER_AGENT: &str = env!("{CARGO_PKG_NAME}-{CARGO_PKG_VERSION}");
assert_eq!(USER_AGENT, "env-smart-1.0.0");