thread_local_scope
Provides a token type LocalScope that guards access to thread local storage, avoiding the need for a separate closure for every access.
LOCAL_ONE.try_with??
becomes
local_scope?
Provides a token type LocalScope that guards access to thread local storage, avoiding the need for a separate closure for every access.
LOCAL_ONE.try_with(|one| {
LOCAL_TWO.try_with(|two| {
...
})
})??
becomes
local_scope(|scope| {
let one = scope.try_access(&LOCAL_ONE)?;
let two = scope.try_access(&LOCAL_TWO)?;
...
})?