Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skull-squadron/lazier_static

A thin layer around `std::sync::OnceLock` providing cached, lazy, static initialization
https://github.com/skull-squadron/lazier_static

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# lazier\_static

## Description

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

## Examples

```rust
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