From 25ac50b4a6595a66dfa6ceba2799c311a1ad6d06 Mon Sep 17 00:00:00 2001 From: Manuel Bichler Date: Wed, 13 Nov 2024 11:04:48 +0100 Subject: [PATCH] Update 12_copy.md Sorry for being nitpicky, but primitive types and single-field structs with Copy types automatically get Copy. However, multi-field structs require you to be explicit about implementing Copy, encouraging you to carefully consider whether a more complex type should be treated as copyable. --- book/src/04_traits/12_copy.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/src/04_traits/12_copy.md b/book/src/04_traits/12_copy.md index f51778ec5d..c4140f1b1b 100644 --- a/book/src/04_traits/12_copy.md +++ b/book/src/04_traits/12_copy.md @@ -108,6 +108,7 @@ You can just derive it, like this: ```rust #[derive(Copy, Clone)] struct MyStruct { - field: u32, + field_1: u32, + field_2: u32, } ```