Email me

Crates / cfg-if

Rust crate · real downloads · data Oct 24, 2026

cfg-if downloads, and should you depend on it?

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. crates.io · docs.rs · repository

Widely usedShould you depend on cfg-if? The data says

Widely used and steady.

cfg-if: 2,759 crates depend on it; downloads don't spike on releases.

4.3Mreal downloads a day (quiet-day median)
2,759crates depend on it
38 dayssince the last release (1.0.5)
+5%quiet-day trend vs the field, 90 days
How this verdict is decided (4 rules)
  • Usage: crates.io reverse dependencies (crates that list it as a dependency): 10,000+ = foundational, 1,000+ = widely used, 100+ = established, under 100 = few direct dependents.
  • Direction: the median quiet day in the last 30 days of the window against the first 30, read against the median tracked crate (the whole field moved +36% from late summer to October, so a raw trend says nothing). 10%+ ahead of the field = gaining; 10%+ behind = losing ground; otherwise steady. Steady with no release in 2+ years = quiet for years.
  • Release spikes: the median release-window day against the quiet-day baseline: under 1.15x = no spike, 1.15x to 1.3x = small bumps, 1.3x or more = jumps on release days.
  • Release recency: days since the newest version that was not yanked, from crates.io publish times.
Data: crates.io API, Jul 27, 2026 to Oct 23, 2026, fetched Oct 24, 2026. Downloads are not users: read the baseline as steady use, not a head count.
2M4M6M2026-07-27: 3,659,4072026-07-28: 3,956,1842026-07-29: 3,971,4332026-07-30: 3,921,6262026-07-31: 3,765,5472026-08-01: 2,669,9602026-08-02: 2,596,0512026-08-03: 3,852,1372026-08-04: 4,122,4472026-08-05: 4,210,0392026-08-06: 3,506,3582026-08-07: 3,961,9712026-08-08: 2,462,2302026-08-09: 2,323,8592026-08-10: 3,870,7472026-08-11: 4,119,2192026-08-12: 4,122,8272026-08-13: 4,251,7152026-08-14: 3,997,5642026-08-15: 2,611,4882026-08-16: 2,508,9732026-08-17: 3,889,6502026-08-18: 4,369,5702026-08-19: 4,239,7202026-08-20: 4,483,0672026-08-21: 4,272,9752026-08-22: 2,665,0252026-08-23: 2,595,6652026-08-24: 4,148,3392026-08-25: 4,436,7332026-08-26: 4,490,2262026-08-27: 4,524,0252026-08-28: 4,450,8502026-08-29: 2,748,1902026-08-30: 2,620,1882026-08-31: 4,315,5742026-09-01: 4,876,5252026-09-02: 5,071,2452026-09-03: 4,840,1302026-09-04: 4,571,3892026-09-05: 3,273,5992026-09-06: 3,021,4082026-09-07: 3,803,0402026-09-08: 4,539,7862026-09-09: 4,758,1402026-09-10: 4,651,1172026-09-11: 4,281,7232026-09-12: 2,910,7162026-09-13: 2,665,4982026-09-14: 4,420,9932026-09-15: 4,879,6212026-09-16: 4,695,012 (release window)2026-09-17: 4,980,234 (release window)2026-09-18: 4,724,6702026-09-19: 3,034,3592026-09-20: 3,018,2582026-09-21: 4,589,7472026-09-22: 5,048,8092026-09-23: 5,245,8212026-09-24: 5,360,4182026-09-25: 5,118,7402026-09-26: 3,383,6052026-09-27: 3,362,0772026-09-28: 5,511,6042026-09-29: 5,650,0932026-09-30: 5,639,5822026-10-01: 5,734,9042026-10-02: 5,459,0112026-10-03: 3,722,8212026-10-04: 3,545,8082026-10-05: 5,297,9722026-10-06: 5,655,2802026-10-07: 5,788,4392026-10-08: 6,041,6442026-10-09: 5,767,1992026-10-10: 4,112,2612026-10-11: 3,833,6162026-10-12: 5,474,1152026-10-13: 6,190,5862026-10-14: 6,529,3612026-10-15: 6,271,4192026-10-16: 5,838,3092026-10-17: 3,943,5902026-10-18: 3,838,7942026-10-19: 6,098,1232026-10-20: 6,499,4862026-10-21: 6,906,8802026-10-22: 6,980,4642026-10-23: 6,532,084Jul 27Aug 1Sep 1Oct 1

release window (release day + next day)quiet dayquiet-day median · download the 89 days as CSV

The numbers in one paragraphcfg-if got 390,701,704 crates.io downloads from Jul 27, 2026 to Oct 23, 2026. 2% of them landed within 2 days of one of its 1 release. On the other 87 quiet days it got a median of 4,272,975 a day, about 29,910,825 a week. Capping release days at that baseline leaves 389,572,408 release-adjusted downloads for the window.

What this means if you're choosing a dependency

  • Well trodden. 2,759 crates depend on it, so common problems tend to have public answers and breaking changes get noticed fast.
  • Actively released. 1.0.5 shipped 38 days ago (Sep 16, 2026).
  • Fit check: license MIT OR Apache-2.0, edition 2018, needs Rust 1.32 or newer (from the latest version's manifest).
  • Compare it by the baseline, not the raw count. 2% of its 390,701,704 downloads in the window landed within 2 days of a release; the steady number is 4,272,975 a day.

Its place in the dependency graph

Built on cfg-if

14 of the 300 crates we track depend on it directly (biggest first).

What the chart says

  • Weekend quiet days ran at 65% of weekday quiet days (2,964,487 vs 4,589,747). A dip that deep is the signature of work-week CI pipelines and developers building on weekdays.
  • Biggest day: 6,980,464 on Oct 22, 2026, a quiet day with no release nearby.

Every number

All-time downloads1,628,799,276 (rank #16 on crates.io by all-time downloads)
Downloads in the window390,701,704 (Jul 27, 2026 to Oct 23, 2026, 89 days)
Within 2 days of a release9,675,246 (2.5%)
Quiet-day median (baseline)4,272,975 a day; weekdays 4,589,747, weekends 2,964,487
Release-adjusted downloads389,572,408 (release-window days capped at the baseline)
Baseline rank#21 of the 300 crates we track
Quiet-day trend+43% raw, +5% against the median tracked crate (+36%)
Releases in the window1
Versions published, ever17
Latest version1.0.5, published Sep 16, 2026 (license MIT OR Apache-2.0, edition 2018, MSRV 1.32)
First publishedJul 8, 2015
Reverse dependencies2,759

Releases in the window

Each one opens a 2-day release window on the chart.

VersionPublishedDownloads that version got (lifetime)
1.0.5Sep 16, 202656,832,118

How we compute this

crates.io counts every download, including CI runners, mirrors and bots that fetch each new version, so raw counts run high (why, in The Manual). We split the last 89 days into release windows (the day a version of cfg-if was published, plus the next day) and quiet days, and use the median quiet day as the baseline: an upper bound on steady use, never a head count. The method and data come from our study of 90 days of crates.io data from 69 crates, featured in This Week in Rust #674; check any crate live with the real-downloads checker.

Badge for your README

Maintainers can show the baseline in a README. It is optional, updates when we refresh the data, and links back here. Preview, then copy:

README, light

cfg-if real downloads per day badge

README, dark

Publishing a crate of your own? How to publish a Rust crate to crates.io, step by step.

Categories

No crates.io category set.

Sources

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Up next

Next by real downloads: The next crate down the real-downloads ranking: 4,161,400 a day. Widely used and steady.serde_deriveRust crate. Macros 1.1 implementation of #[derive(Serialize, Deserialize)]. Real use: 4.2M downloads a day on quiet days; 6,497 crates depend on it.Read it next →

Also worth your time

Did this answer your question?

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ