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
After a quick look, I think it would require a fairly significant API rework that employs the use of guards (perhaps ThreadLocalGuard and ThreadLocalMutGuard) that could maybe impl Deref and DerefMut to the underlying value. In much the same way as IterMut is implemented:
OK after a fundamental Rust refresher, I think my original comment is partly correct. However, you have to also add a get_inner_mut method. I'll see if I can do a PR.
Based on a brief exchange with @Kestrer:
#31 (comment)
After a quick look, I think it would require a fairly significant API rework that employs the use of guards (perhaps
ThreadLocalGuard
andThreadLocalMutGuard
) that could maybe impl Deref and DerefMut to the underlying value. In much the same way asIterMut
is implemented:https://docs.rs/thread_local/latest/src/thread_local/lib.rs.html#468-471
Scratch that, I think I may have a working implementation.Nope, yeah I think guards may be needed
The text was updated successfully, but these errors were encountered: