uazu / qcell

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

Implement PartialEq and Eq for QCellOwnerID #38

Closed simonask closed 1 year ago

simonask commented 1 year ago

I have a use case where QCells are used to manage the internal state of objects belonging to a particular "world", and mixing objects from different "worlds" is an error.

Checking the equality of QCellOwnerID allows me to catch errors without panicking, without introducing a separate "world ID" only for this purpose, and to provide better diagnostics to the user of my library.

As far as I can tell, there are no hazards associated with this change.

uazu commented 1 year ago

I think this is okay. You could get the same functionality (very much less efficiently) by attempting a borrow within a catch_unwind. So I think this is will be fine.

Do you need a new release with this in soon?