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
Working with lazy initialized values is ubiquitous, [`lazy_static`] and [`lazycell`] crates have more than 20 million downloads combined.
25
-
Although some of the popularity of `lazy_static` can be attributed to current limitations of constant evaluation in Rust, there are many cases when even perfect const fn can't replace lazy values.
25
+
Although some of the popularity of `lazy_static` can be attributed to current limitations of constant evaluation in Rust, there are many cases when even perfect `const fn` can't replace lazy values.
26
26
27
27
At the same time, working with lazy values in Rust is not easy:
28
28
@@ -333,7 +333,7 @@ type OnceCell<T> = OnceFlipCell<(), T>;
333
333
334
334
That is, we can store some initial state in the cell and consume it during initialization.
335
335
In practice, such flexibility seems to be rarely required.
336
-
Even if we add a type, similar to `OnceFlipCell`, having a dedicated `OnceCell` (which *could* be implemented on top of `OnceFlipCell`) type simplifies common use-case.
336
+
Even if we add a type, similar to `OnceFlipCell`, having a dedicated `OnceCell` (which *could* be implemented on top of `OnceFlipCell`) type simplifies a common use-case.
337
337
338
338
## Poisoning
339
339
@@ -380,7 +380,7 @@ There are two drawbacks of using fn pointer type:
0 commit comments