Install
cfg-if
A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted.
1.0.5Latest, 16 Sep 2026
513MDownloads, last 90 days
0Advisories on the latest
0Advisories, all versions
MIT OR Apache-2.0Licence
646Stars
3.9/10OpenSSF Scorecard
Source · Ask AI Mode · · Markdown
In the news
- The Django-CFG Manifesto — or, How I Stopped Worshiping settings.py and Let AI Build My Apps dev.to, 5 Oct 2025
- Writing Tests with #[cfg(test)] and Modules dev.to, 21 May 2025
- How can Rust procedural macro parser solve `cfg` or `cfg_attr` conditions stackoverflow.com, 24 Jan 2025
- Compact default generic declaration based on cfg stackoverflow.com, 24 Jan 2025
- unexpected `cfg` condition value: solana stackoverflow.com, 26 Nov 2024
Sources: crates.io, deps.dev (CC BY 4.0), OSV. Last checked 3 Dec 2026.