Crates / lazy_static / Alternatives
Rust crate alternatives · data Oct 24, 2026
Alternatives to lazy_static
Short answerThe closest alternatives to lazy_static on crates.io data are once_cell (3.8M real downloads a day), static_assertions (1.4M real downloads a day), quick-error (1.1M real downloads a day). Of the 8 we list, the most used is once_cell, and 2 shipped a release in the last year. lazy_static itself gets 2,449,997 a day with 10,953 dependents.
Every alternative we found
| Alternative | Real downloads a day | vs lazy_static | Dependents | Last release | Why it is listed | |
|---|---|---|---|---|---|---|
| once_cell Widely used | 3,785,180 | 1.54x | 8,656 | 7mo | category Memory management, category Rust patterns, keyword "lazy", keyword "static" | side by side |
| static_assertions Widely used | 1,442,265 | 0.59x | 1,688 | 7.0y | category No standard library, category Rust patterns, keyword "static" | compare |
| quick-error Established | 1,130,044 | 0.46x | 293 | 5.5y | category Rust patterns, keyword "macro" | compare |
| new_debug_unreachable Pulled in | 691,350 | 0.28x | 23 | 2.6y | category No standard library, category Rust patterns, keyword "macro" | compare |
| derive_builder Widely used | 633,349 | 0.26x | 1,332 | 2.0y | category Rust patterns, keyword "macro" | compare |
| derive_builder_macro Pulled in | 624,830 | 0.26x | 1 | 2.0y | category Rust patterns, keyword "macro" | compare |
| educe Established | 380,869 | 0.16x | 191 | 41d | category No standard library, category Rust patterns, keyword "macro" | compare |
| derivative Established | 320,737 | 0.13x | 616 | 5.7y | category Rust patterns, keyword "macro" | compare |
How to choose
- Same job, not the same API. Each line is listed because it shares a crates.io category or keyword with lazy_static; read its description before you swap.
- More dependents means more answered questions and a smaller chance it disappears.
- Check the last release against how fast you need fixes. For lazy_static: is it still maintained?
Rules
Alternatives = tracked crates (top 1000 by downloads) that share a specific crates.io category (2 points each) or keyword (3 points each) with lazy_static, most similar first; its own parts (same name prefix) and crates it depends on or that depend on it are left out, because those are companions, not substitutes. Real downloads = quiet-day median, crates.io data Oct 24, 2026. Built when we find 3 or more.
Up next
The closest alternative: Widely used and steady. 3,785,180 real downloads a day.once_cellRust crate. Single assignment cells and lazy values. Real use: 3.8M downloads a day on quiet days; 8,656 crates depend on it.Read it next →Also worth your time