rust-lang-nursery/lazy-static.rs
View on GitHub ↗ ★ 2,033 Rust archived
A small macro for defining lazy evaluated static variables in Rust.
4 mentions on Hacker News by 4 people: 0 stories, 4 comments · first 2016-07-04 · latest 2021-04-17
20082026
-
…#[cfg(doctest)] doctest!("../README.md"); Now, the readme examples are tested like everything else. https://github.com/rust-lang-nursery/lazy-static.rs/blob/mas...
comment by Rompect · 2021-04-17 · in I'd like to review your README -
…problem was using sort_by_key with a tuple like (a.year, a.month, a.day, a.hour, a.minute). [0]: https://github.com/rust-lang-nursery/lazy-static.rs#example
comment by tlent · 2019-02-04 · in Learning Rust via Advent of Code -
…-> usize provided by the Rust core library. This can be solved by using the lazy_static crate: https://github.com/rust-lang-nursery/lazy-static.rs From the description in the README: Using this macro, it is possible to have statics that…
comment by bascule · 2017-04-13 · in Ownership is Theft: Experiences Building an Embedded OS in Rust (2015) [pdf] -
…without the magic of the event loop. In Rust you'd have to either make an few (unsafe) global ( https://github.com/rust-lang-nursery/lazy-static.rs ) structures to keep track of the event-driven state, or pass them into every callback, or…
comment by pas · 2016-07-04 · in Ruma, a Matrix homeserver written in Rust