envparse
Quick and dirty crate for parsing values out of an environment var provided at compile time. See also: docs.
Usage
Here's an example
const MAX_LEN: usize = parse_env!;
You can bound by ranges too. This one will fail because the
MUST_BE_USER_PROVIDED
var isn't provided.
const MAX_LEN_LOG2: u32 = parse_env!;
const MAX_LEN: usize = 1 << MAX_LEN_LOG2;
You can also try
const MAX_LEN_LOG2: u32 = match parse_env!
const MAX_LEN: usize = 1 << MAX_LEN_LOG2;