I'm writing a graphics app that has state information that needs to be passed through closures. Some of the state is immutable, which isn't a problem. There are 6 or so mutable state variables. I originally wrote it up with each of them being wrapped in a Cell or RefCell, and this works, but makes the code harder to read since even simple assignments need to call .get() or .set().
I then rewrote it using a new struct MutableState that contains all the mutable state variables and wrap that one value in a RefCell. This way a single borrow() at the start of a method makes all the variable accesses look much more natural. It has a cost though: if a lower level method needs mutable access to a state variable the state cannot be borrowed in scope anywhere above in the call stack. This can be handled by making sure references to the state drop out of scope before making calls that might need mutable access.
In general, is one of these two patterns considered better form than the other? Is there a general feeling one is better, or would it just be a case of whichever seems appropriate in the application?