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
Copy file name to clipboardExpand all lines: posts/2023-10-05-Rust-1.73.0.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ right: "🐟"</code></pre></div>
56
56
57
57
### Thread local initialization
58
58
59
-
As proposed in [RFC 3184](https://github.com/rust-lang/rfcs/blob/master/text/3184-thread-local-cell-methods.md), `LocalKey<Cell<T>>` and `LocalKey<RefCell<T>>` can now be directly manipulated with `get()`, `set()`, `take()`, and `replace()` methods without jumping through a `with(|inner| ...)` closure which is necessary for general `LocalKey` work. `LocalKey<T>` is the type of `thread_local!` statics.
59
+
As proposed in [RFC 3184](https://github.com/rust-lang/rfcs/blob/master/text/3184-thread-local-cell-methods.md), `LocalKey<Cell<T>>` and `LocalKey<RefCell<T>>` can now be directly manipulated with `get()`, `set()`, `take()`, and `replace()` methods, rather than jumping through a `with(|inner| ...)` closure as needed for general `LocalKey` work. `LocalKey<T>` is the type of `thread_local!` statics.
60
60
61
61
The new methods make common code more concise and avoid running the extra initialization code for the default value specified in `thread_local!` for new threads.
0 commit comments