I see people make the same mistakes over and over again when learning Rust.
Here are my thoughts (ordered by importance) on how you can ease the learning process.
My goal is to help you save time and frustration.
<…
Yep. One reason why those situations become less frequent over time is that one learns to avoid such designs. Thought process:
“Sharing data across threads is annoying. So I’d rather avoid it. Maybe message passing can solve the same problem as well?”
I just use Arc::clone() now that I know I can just throw the problematic data types on the heap easily. I’m sure there are “better” ways to do it, but ¯\_(ツ)_/¯
Yep. One reason why those situations become less frequent over time is that one learns to avoid such designs. Thought process: “Sharing data across threads is annoying. So I’d rather avoid it. Maybe message passing can solve the same problem as well?”
I just use
Arc::clone()
now that I know I can just throw the problematic data types on the heap easily. I’m sure there are “better” ways to do it, but¯\_(ツ)_/¯