mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-02 07:37:24 +02:00
Copy, clone speaker notes: phrase as sentences i/o questions
This commit is contained in:
parent
e29c3bfb99
commit
65837087c9
@ -40,8 +40,8 @@ Copying and cloning are not the same thing:
|
||||
|
||||
In the above example, try the following:
|
||||
|
||||
* What happens when you add a `String` field to `struct Point`?
|
||||
* Does it work when you remove `Copy` from the `derive` attribute?
|
||||
* After removing `Copy`, can you still print `p1` after the move?
|
||||
* Add a `String` field to `struct Point`. It will not compile because `String` is not a `Copy` type.
|
||||
* Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for `p1`.
|
||||
* Show that it works if you then clone `p1`.
|
||||
|
||||
</details>
|
||||
|
Loading…
x
Reference in New Issue
Block a user