1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-09 01:02:47 +02:00

Update copy-clone.md (#221)

This commit is contained in:
Igor Petruk 2023-01-23 20:26:21 +00:00 committed by GitHub
parent fe8fa8d232
commit 912f592199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,4 +45,7 @@ In the above example, try the following:
* Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for `p1`.
* Show that it works if you clone `p1` instead.
If students ask about `derive`, it is sufficient to say that this is a way to generate code in Rust
at compile time. In this case the default implementations of `Copy` and `Clone` traits are generated.
</details>