crates.io docs.rs license

env_ast

Dead simple procedural macro that mimics env! but outputs AST tokens instead of a string literal.

WARNING: This macro is potentially DANGEROUS and can introduce arbitrary code execution (ACE) if used improperly. If you need this macro, make sure you REALLY need it.

Usage

Simply add to your Cargo.toml file:

toml [dependencies] env_ast = "*"

And in your code:

```rust

[macrouse] extern crate envast;

fn itworks() {} fn defaultworks() {}

fn main() { envast!("MYENVVAR")(); // For this to compile, MYENVVAR must be set to it_works at build time envast!("ENVVARTHATISNOTSET", defaultworks)(); // You can provide a default set of tokens if the environment variable is not found } ```