lazier_static

Crates.iolazier_static
lib.rslazier_static
version0.1.2
sourcesrc
created_at2024-05-30 10:49:21.103624
updated_at2024-05-30 11:06:36.039819
descriptionA thin wrapper around `std::sync::OnceLock` providing cached, static, lazy initialization.
homepagehttps://github.com/skull-squadron/lazier_static
repositoryhttps://github.com/skull-squadron/lazier_static
max_upload_size
id1256775
size4,314
🏴‍☠️ (skull-squadron)

documentation

https://docs.rs/lazier_static

README

lazier_static

Description

A thin layer around std::sync::OnceLock providing cached, lazy, static initialization.

Examples

use lazier_static::*;

lazier_static! {
    fn hello_world() -> &str {
        "Hello, World!"
    }

    fn number() -> i32 {
        10 * 32
    }
}

fn main() {
    println!("{}", number());
}

Usage

cargo command

cargo add lazier_static

Cargo.toml

lazier_static = "0.1.2"

License

MIT OR Apache-2.0

Commit count: 8

cargo fmt