Giter VIP home page Giter VIP logo

const_env's People

Contributors

ekardnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

const_env's Issues

Feature Request: Add support for arrays

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. โœŒ๏ธ

Only works if the code changes

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.

Rerun compilation if env changed

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");

Update documentation

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.

Add compiletest-rs tests.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.