Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/skull-squadron/lazier_static
- Owner: skull-squadron
- Created: 2024-05-30T10:47:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-30T11:07:31.000Z (8 months ago)
- Last Synced: 2024-11-08T20:08:17.033Z (2 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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