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.
2 parents 7d6658f + bee791c commit e46c7b9Copy full SHA for e46c7b9
src/custom_types/structs.md
@@ -48,13 +48,14 @@ fn main() {
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 };
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
- let bottom_right = Point { x: 5.2, ..point };
58
+ let bottom_right = Point { x: 5.2, ..another_point };
59
60
// `bottom_right.y` will be the same as `point.y` because we used that field
61
// from `point`
0 commit comments