Crates / Compare / once_cell vs static_assertions
Rust crates side by side · data Oct 24, 2026
once_cell vs static_assertions
Short answerBy steady daily use, once_cell is bigger: 3,785,180 real downloads a day against 1,442,265 for static_assertions (2.6x). 8,656 crates depend on once_cell and 1,688 on static_assertions. once_cell last shipped 7 months ago, static_assertions 7.0 years ago.
once_cell
Widely usedWidely used and steady.
8,656 crates depend on it; no release in the last 90 days, so its count is all steady use.
Single assignment cells and lazy values.
static_assertions
Widely usedWidely used and quiet for years.
1,688 crates depend on it; no release in the last 90 days, so its count is all steady use.
Compile-time assertions to ensure that invariants are met.
once_cellstatic_assertions · 100% = that crate's normal quiet day, so a spike to 300% is triple its usual traffic
Every number, side by side
| Same window, same method | once_cell | static_assertions |
|---|---|---|
| Real downloads a day | 3,785,180 | 1,442,265 |
| Crates that depend on it | 8,656 | 1,688 |
| Last release | 1.21.4, 7 months ago | 1.1.0, 7.0 years ago |
| Trend vs the field | -3% | +1% |
| Release-window share | 0.0% | 0.0% |
| Downloads in the window | 336,233,853 | 130,951,945 |
| All-time downloads | 1,416,715,677 | 561,828,019 |
| Versions published | 67 | 15 |
| License | MIT OR Apache-2.0 | MIT OR Apache-2.0 |
| MSRV | 1.65 | not set |
| First published | Aug 2, 2018 | Aug 13, 2017 |
Which to pick
- Downloads tell you what is common, not what fits. Each crate's own description above says what it is for; when the jobs differ, pick by the job.
- When both fit, prefer the one more crates depend on (once_cell, 8,656 dependents): more eyes, more answered questions, and you may already have it in your tree.
- Check the release dates against your own pace: once_cell 7 months ago, static_assertions 7.0 years ago.
Also in this space
Method
Real downloads = the median day with no release that day or the day before, from the crates.io API (Jul 27, 2026 to Oct 23, 2026). Raw crates.io counts include CI and bots and run high (why); the method is from our 90-day study.
Up next
Another comparison: Same method, same window. Widely used and steady vs foundational and steady.once_cell vs lazy_staticRead it next →Also worth your time