Problem
lets consider following code:
use OnceCell;
// having to recompute string() over and over might be expensive (not in this example, but still)
// so we use lazy initialization
// And now it can be used like this
;
;
Solution
This crate was designed to solve this particular problem.
Lets make some changes:
use StaticTypeMap;
use OnceCell;
// having to recompute string() over and over might be expensive (not in this example, but still)
// so we use lazy initialization
// And now it can be used like this
;
;
Drawbacks
Current implementation uses RwLock to make it safe in concurrent applications, which will be slightly slower then regular