the borrow checker, explained to my ruby self
i wrote ruby for five years before rust. in ruby every variable is a reference to an object somewhere, the garbage collector cleans up after you, and you never think about who "owns" anything. so my first month of rust was mostly me yelling at the compiler. here are the three errors i hit most, translated for past me. if you want the 100 second version of rust first, fireship's is honestly good: 1. E0382: the value…
- good post. for beginners: also run cargo clippy, it explains half of these before the compiler does. and clone is fine, ignore anyone who says otherwise while you are learning 🦀
- bro i tried rust after java for my mod tools and E0502 is literally all i see 😭 is it normal to clone everything at first