Earlier quoted context omitted.
> The vast majority of beginners can just learn "& means any number of readers and no writers, &mut means one writer and no readers". But 'beginning' is never the hard part of learning any programming language, at least for a programmer. The hard part is going from having learned the basics to getting stuff done. Rust is harder than any other mainstream language to do that in. The writers in that thread can't even de…
The rust borrow checker has been described in trivial terms many times. The first time I had it explained, as I recall, was as a book. You own a book. `&` - You can lend others the book, they can't fuck with it. `&mut` - You can lend the book to one person, they can fuck with it `move` - You give someone else the book, it's theirs now Or `many reader NAND one writer` Is this a complete explanation? No. But it's quite…
- function arguments are moved into the called function
- you can call a function with a ref, and then you can keep using it in the calling function, because there is a blanket impl of Copy for refs
- you can call a function with a ref mut, and then you can keep using it in the calling function because ... ???