Support for compile-time environment variable lookup
First off, thank you for the great crate!
I'm now generating some plaintext in build.rs to $OUT_DIR/foo.txt, and including it in the library code like include_str!(concat!(env!("OUT_DIR"), "/foo.txt")). It'd be great if flate! also supports either
flate!(concat!(env!("OUT_DIR"), "/foo.txt")), orflate!("$OUT_DIR/foo.txt")
so that one can use include-flate for generated file stored in OUT_DIR (or wherever else relative to an environment variable).
I don't think macro resolution is currently possible in stable Rust. The second option of shell expansion is possible, but it breaks backwards compatibility. Perhaps we can consider a separate syntax?
flate_env!(OUT_DIR, "foo.txt")
different pieces are joined, non-literal components are parsed as identifiers that interpret as environment variable names.
That totally makes sense to me! Probably flate!(OUT_DIR, "foo.txt") is also backward compatible, but I see benefit of separating the macro.