Skip to content

Commit 1d3572c

Browse files
committed
Corrected x values for example rectangle
1 parent 859786c commit 1d3572c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/custom_types/structs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ fn main() {
4747
println!("{:?}", peter);
4848
4949
// Instantiate a `Point`
50-
let point: Point = Point { x: 10.3, y: 0.4 };
51-
let another_point: Point = Point { x: 5.2, y: 0.2 };
50+
let point: Point = Point { x: 5.2, y: 0.4 };
51+
let another_point: Point = Point { x: 10.3, y: 0.2 };
5252
5353
// Access the fields of the point
5454
println!("point coordinates: ({}, {})", point.x, point.y);
5555
5656
// Make a new point by using struct update syntax to use the fields of our
5757
// other one
58-
let bottom_right = Point { x: 5.2, ..another_point };
58+
let bottom_right = Point { x: 10.3, ..another_point };
5959
6060
// `bottom_right.y` will be the same as `another_point.y` because we used that field
6161
// from `another_point`

0 commit comments

Comments
 (0)