aurae
aurae copied to clipboard
Cells should be immutable
We should not be able to change a cell after it has been created, you must destroy the cell and allocate a new one if you want to change anything about the cell.
Reviewing the code as it is now, we are almost there. I think we can make this possible in 2 steps:
- Create a 3rd variant on
CellStatecalledFreedthat change thefn freeto set that state instead of going back toUnallocated(this preventsCell.allocatefrom doing anything inFreedalso. - We also want to make sure that we don't accidentally make any of
Cell's fields public. We can do this 2 ways: a. Write a comment and hope it gets paid attention too b. Obviously a macro that will override any attempt to setpuborpub(crate)(there may be a crate for this if we want this choice, or it shouldn't be hard to write)
#180 implements step 1 and step 2a.
i'm happy with this until we find out it was insufficient and the comment ended up being a sign not a cop.