You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Boiethios, since the lazy_static macro lies about its type in the declaration I think we could create more confusion by not having it explicitly wrapped in a macro, where you can expect to be outside the realms of standard Rust syntax.
As another alternative, I personally like the API from #111 where the macro moves just to the body of the static declaration:
staticGLOBAL_DATA:Lazy<Mutex<HashMap<i32,String>>> = sync_lazy!{letmut 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: