envint

Crates.ioenvint
lib.rsenvint
version0.1.2
created_at2025-10-11 01:51:27.059684+00
updated_at2025-10-11 02:09:06.588246+00
descriptionA quick & dirty proc-macro to parse env variables into integers for compile-time configuration
homepage
repositoryhttps://github.com/maxrt101/envint
max_upload_size
id1877737
size6,560
Max (maxrt101)

documentation

README

envint

A quick & dirty proc-macro to parse env variables into integers for compile-time configuration

Installation

$ cargo add envint

Usage:

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);
Commit count: 0

cargo fmt