macro_rules! env_i32_default {
($var:literal,$default:literal) => { ... };
}
Expand description
Get an i32 value from the compile-time environment, or if the environment variable is not present or is not an i32, use the provided default value.
This is useful for configuring your program as there is no good way of asking for user input at runtime.
Usage:
ⓘ
let x = env_i32_default!("SOME_ENVIRONMENT_VARIABLE", 50);