| Crates.io | envint |
| lib.rs | envint |
| version | 0.1.2 |
| created_at | 2025-10-11 01:51:27.059684+00 |
| updated_at | 2025-10-11 02:09:06.588246+00 |
| description | A quick & dirty proc-macro to parse env variables into integers for compile-time configuration |
| homepage | |
| repository | https://github.com/maxrt101/envint |
| max_upload_size | |
| id | 1877737 |
| size | 6,560 |
A quick & dirty proc-macro to parse env variables into integers for compile-time configuration
$ cargo add envint
Call the macro with first argument being the env variable name, and second - default value, if env variable couldn't be found.
// Define env variable `SIZE` somewhere in project, for example in `.cargo/config.toml` `[env]` section
const SIZE: usize = envint::envint!("SIZE", 10);