3 ms·
I don’t see how that code is safe or can be considered so. Your signature suggests that you mutably borrow self. Even if you only use a member, the signature co
by csomar 3y ago
I don’t see how that code is safe or can be considered so. Your signature suggests that you mutably borrow self. Even if you only use a member, the signature could confuse fellow developers that they can play with the whole object.
I’ll use an Arc or an Rc depending on the need of thread safety. I think way too many people are over optimizing their Rust programs. Unless you are building for resource constrained devices, I think the cost of atomic primitives is negligible.