InteriorAssign trait { a := b }
Rust Internals [Unofficial]
May 12, 2026
jrose:
I'll add to the general negative feeling here by pointing out that with RefCell this operation can panic and so I might not want to use it anyway
I agree. In hindsight I should have made it wrap the try_borrow_mut instead.
I do like that I know this now:
steffahn:
*data.ref_cell.borrow_mut() = Some(new_value);
Which I was unaware of when I made the post. Preserving the left and right side of the equals was the main issue I had.
I think what I might do instead though is just create a macro or use scripting because all I really want to do is abstract away a pattern that is going to be repeated thousands of times.
Discussion in the ATmosphere