I am making things easy for myself on this Rust journey by focusing on only using the most basic stuff
You know, like modules, workspaces, generics, interior mutability, declarative and procedural macros…
I am making things easy for myself on this Rust journey by focusing on only using the most basic stuff
You know, like modules, workspaces, generics, interior mutability, declarative and procedural macros…
Finding that a lot of really useful Rust features are very thinly documented. `Arc::make_mut()` is an *incredibly* powerful feature that is barely discussed. I only discovered it as a passing mention in the `Cow` docs. Just this one method has shaved literally hundreds of lines off the code I'm writing…
@jonathanhogg Absolutely not comparable `Arc<Mutex<>>` gives shared access to mutable content, `Arc::make_mut()` is clone-on-write, so you mutate ONLY the copy, changes not reflected anywhere else; all `Weak` pointers are invalidated.
@michalfita you’ll find that I didn’t say they were comparable, just that the latter is thinly documented. Copy-on-write was exactly the behaviour I needed and a Mutex was how I was hacking it first time round
@jonathanhogg OK, fine then.
Nice you discovered something you like in #Rust.