Skip to content

Commit bee791c

Browse files
committed
Fixes the bug: #1721
1 parent 7d6658f commit bee791c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/custom_types/structs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ fn main() {
4848
4949
// Instantiate a `Point`
5050
let point: Point = Point { x: 10.3, y: 0.4 };
51+
let another_point: Point = Point { x: 5.2, y: 0.2 };
5152
5253
// Access the fields of the point
5354
println!("point coordinates: ({}, {})", point.x, point.y);
5455
5556
// Make a new point by using struct update syntax to use the fields of our
5657
// other one
57-
let bottom_right = Point { x: 5.2, ..point };
58+
let bottom_right = Point { x: 5.2, ..another_point };
5859
5960
// `bottom_right.y` will be the same as `point.y` because we used that field
6061
// from `point`

0 commit comments

Comments
 (0)