4 ms·
The first thing I tell people is ".clone() it, Box it, Arc it. You can make it faster later." Experienced devs see an Arc<RwLock<T>> and are tickled by the "ob
by estebank 3y ago
The first thing I tell people is ".clone() it, Box it, Arc it. You can make it faster later."
Experienced devs see an Arc<RwLock<T>> and are tickled by the "obvious" performance impact, but then they try to use higher ranked lifetimes before fully internalizing the rules and get frustrated. The Rust Way there is to look at how you can reframe the problem to minimize the pain, because that pain is a symptom of an ownership web that's too complex.
If you use the wrapper types while you learn the language, it makes it easier to focus only on learning the lifetime rules, instead of trying to learn the whole language at once.