ekardnt / const_env Goto Github PK
View Code? Open in Web Editor NEWConfigure const and static items by environment variables.
License: Creative Commons Zero v1.0 Universal
Configure const and static items by environment variables.
License: Creative Commons Zero v1.0 Universal
Thanks a lot for the crate! I would like to add support for arrays. Considering that there is no active development, I may try to do it myself later. โ๏ธ
I've noticed this only appears to work when the code changes.
For example, if you have this:
#[const_env::from_env]
static SWITCH: bool = false;
fn main() {
...
}
On first compile, you can change the value to true
with:
SWITCH=true cargo build
However, if you change the env var and rebuild like so:
SWITCH=false cargo build
The value is still set to true
until the code is changed and recompiled as per last command.
Need to do a better job of reporting errors. Currently we just panic whenever we encounter a problem.
Hi, thank you for this cool crate. It works well but I have one problem. Cargo seems to cache compilation and not recompile when the environment variables change. Is it possible to add some similar functionality to:
// build.rs
println!("cargo:rerun-if-env-changed=FOO");
Right now documentation is placeholder, need to update. Also consider hiding documentation for publish items in const_env_impl that are implementation details only exposed due to needing a separate impl crate for proc macros.
All tests are so far in const_env_impl, and don't actually invoke the proc macro itself. By using compiletest-rs we should be able to invoke the proc macro and hopefully pass environment variables.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.