lazy_static 1.5.0

A macro for declaring lazily evaluated statics in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[macro_use]
extern crate lazy_static;

mod outer {
    pub mod inner {
        lazy_static! {
            pub(in outer) static ref FOO: () = ();
        }
    }
}

fn main() {
    assert_eq!(*outer::inner::FOO, ());
}