Skip to content

Commit b1040e3

Browse files
tonowakwprzytula
andcommitted
Update content/lessons/03_data_types/data_types.rs
Co-authored-by: Wojciech Przytuła <[email protected]>
1 parent 6a527d0 commit b1040e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/lessons/03_data_types/data_types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ fn main() {
5858
let mut hero: Hero = Hero::new(String::from("Ferris"));
5959
hero.level_up(); // 'self' is always passed implicitly as the first argument.
6060

61-
// Thanks to `..hero`, fields other than 'name' will be the same as in 'hero' (copy).
61+
// Thanks to `..hero`, fields other than 'name' will be the same as in 'hero'.
62+
// In general, they are moved. Here, they are copied, because all missing fields
63+
// implement the `Copy` trait.
6264
let steve = Hero {
6365
name: String::from("Steve The Normal Guy"),
6466
..hero

0 commit comments

Comments
 (0)