uazu / qcell

Statically-checked alternatives to RefCell and RwLock
Apache License 2.0
356 stars 22 forks source link

Add `get_mut` to `LCell` and define `repr(transparent)` #36

Closed CeleritasCelery closed 2 years ago

CeleritasCelery commented 2 years ago

This makes the API more complete and matches the function in std::cell::RefCell. This still upholds the invariants of LCell. Repr transparent was also added as an extra guarantee this type can provide. This makes it easier to use it soundly in unsafe code.

uazu commented 2 years ago

Yes, this looks okay -- thanks. I will implement the same for the other cell types (where applicable) and add tests, and whilst I'm at it, I think I'll also add into_inner (which was requested separately).

uazu commented 2 years ago

It's now published in version 0.5.2