Toot :
๐ฆ In #rustlang 1.73.0 (to be released on October 5th), it'll be easier to use thread_local Cells and RefCells: the set, get, replace, take, and with_borrow[_mut] methods will be directly available on the thread local, removing the need for the usual
.with(|_| โฆ)
pattern: 1/2
The new
.set()
method can be more efficient than.with(|x| x.set())
, because it skips the step where the first call towith
initializes the variable. The option to skip the default initializer can be very useful in some situations:
2/2