We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 859786c commit 1d3572cCopy full SHA for 1d3572c
src/custom_types/structs.md
@@ -47,15 +47,15 @@ fn main() {
47
println!("{:?}", peter);
48
49
// 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 };
+ let point: Point = Point { x: 5.2, y: 0.4 };
+ let another_point: Point = Point { x: 10.3, y: 0.2 };
52
53
// Access the fields of the point
54
println!("point coordinates: ({}, {})", point.x, point.y);
55
56
// Make a new point by using struct update syntax to use the fields of our
57
// other one
58
- let bottom_right = Point { x: 5.2, ..another_point };
+ let bottom_right = Point { x: 10.3, ..another_point };
59
60
// `bottom_right.y` will be the same as `another_point.y` because we used that field
61
// from `another_point`
0 commit comments