const_env--value 0.1.2

Configure const and static items by environment variables.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extern crate const_env;

use const_env::from_env;

#[from_env("EXPLICIT_OVERRIDE_ISIZE")]
const EXPLICIT_ISIZE: isize = 0;

#[from_env("EXPLICIT_OVERRIDE_F64")]
const EXPLICIT_F64: f64 = 0.0;

fn main() {
    assert_eq!(123, EXPLICIT_ISIZE);
    assert_eq!(123.0, EXPLICIT_F64);
}