Re:The Adoption of Rust in Business
by zozbot234 on Tuesday February 07, 2023 @11:30AM
(#34694858)
Rust only prevents shared mutable data by default. You can always mutate things in a local context (i.e. objects that are either owned or uniquely borrowed) or use the "cell" constructs to opt-in to shared mutable state.
[ Parent
| on HN ]
> You can always mutate things in a local context (i.e. objects that are either owned or uniquely borrowed)
You do have to explicitly declare them mutable, though, and will warn you if you have a mutable variable that you never mutate. This is helpful for avoiding surprises.