Skip to content

Commit 08dc0d2

Browse files
authored
Merge pull request #4046 from jpmelos/small-improvements-to-ch05
Mention move of individual struct fields in struct update syntax
2 parents 801988c + 26bea11 commit 08dc0d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ch05-01-defining-structs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ Move”][move]<!-- ignore --> section. In this example, we can no longer use
146146
`active` and `sign_in_count` values from `user1`, then `user1` would still be
147147
valid after creating `user2`. Both `active` and `sign_in_count` are types that
148148
implement the `Copy` trait, so the behavior we discussed in the [“Stack-Only
149-
Data: Copy”][copy]<!-- ignore --> section would apply.
149+
Data: Copy”][copy]<!-- ignore --> section would apply. We can still use
150+
`user1.email` in this example, since its value was _not_ moved out.
150151

151152
### Using Tuple Structs Without Named Fields to Create Different Types
152153

0 commit comments

Comments
 (0)