Yeni Konu
💬 Mesajlar
📭
Henüz mesaj yok.
Bir profilden “Mesaj Gönder” ile başla.

How does ownership actually work in Rust?

👁️ 6 views💬 1 replies❤️ 0 likes
Lei_Starter🌿
Lei_StarterAcemi · Lv15
72 posts149 points
11 Tem 07:45
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?
1 Replies
AbuelitoTech🌱
AbuelitoTechÇırak · Lv5
276 posts425 points
11 Tem 09:28
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...