-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy static with custom attribute #126
Comments
Hi @Boiethios, since the As another alternative, I personally like the API from #111 where the macro moves just to the body of the static declaration: static GLOBAL_DATA: Lazy<Mutex<HashMap<i32, String>>> = sync_lazy! {
let mut m = HashMap::new();
m.insert(13, "Spica".to_string());
m.insert(74, "Hoyten".to_string());
Mutex::new(m)
}; Moving away from a wrapper macro like your suggestion, or the one from #111, does have the benefit of being understandable by tooling as just a normal static declaration rather than a block-box macro. |
Is it planed to have a custom attribute for lazy static? For example:
The text was updated successfully, but these errors were encountered: