mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-12 05:24:12 +02:00
Ownership speaker notes (#172)
* ownership speaker notes Co-authored-by: Martin Geisler <mgeisler@google.com>
This commit is contained in:
parent
b602dc9be4
commit
13da3112e9
@ -16,3 +16,11 @@ fn main() {
|
||||
* When `s1` goes out of scope, nothing happens: it has no ownership.
|
||||
* When `s2` goes out of scope, the string data is freed.
|
||||
* There is always _exactly_ one variable binding which owns a value.
|
||||
|
||||
<details>
|
||||
|
||||
* Mention that this is the opposite of the defaults in C++, which copies by value unless you use `std::move` (and the move constructor is defined!).
|
||||
|
||||
* In Rust, you clones are explicit (by using `clone`).
|
||||
|
||||
</details>
|
Loading…
Reference in New Issue
Block a user