Macro once_cell::unsync_lazy[][src]

macro_rules! unsync_lazy {
    ($($block:tt)*) => { ... };
}

Creates a new lazy value initialized by the given closure block. This macro works in const contexts. If you need a move closure, use Lazy::new constructor function.

Example

let hello = "Hello, World!".to_string();

let lazy = unsync_lazy! {
    hello.to_uppercase()
};

assert_eq!(&*lazy, "HELLO, WORLD!");