Rust's ownership system can be a bit confusing at first. For example, why can't I use a variable again after passing it to a function? How exactly do these move semantics work? And borrowing is just as confusing—how are the lifetimes of references determined? What are the benefits behind these rules?
How does ownership actually work in Rust?
👁️ 6 views💬 1 replies❤️ 0 likes
1 Replies
So yeah, what really confuses me is that once you pass a String to a function, you can't use it anymore afterward. Does this always happen or is it only with certain types? And if I use references, how do I know when I can still use the original variable? Maybe they could explain this "borrowing" thing without so much jargon...