From 1d5fd8989e7eb79ecbd27f765e337168c893fa26 Mon Sep 17 00:00:00 2001 From: Kilian Date: Thu, 30 May 2024 15:34:40 +0200 Subject: [PATCH 1/2] changed incorrect variable name --- src/custom_types/structs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/custom_types/structs.md b/src/custom_types/structs.md index 84610547b2..ac7a039b71 100644 --- a/src/custom_types/structs.md +++ b/src/custom_types/structs.md @@ -55,7 +55,7 @@ fn main() { // Make a new point by using struct update syntax to use the fields of our // other one - let bottom_right = Point { x: 5.2, ..another_point }; + let bottom_right = Point { x: 5.2, ..point }; // `bottom_right.y` will be the same as `point.y` because we used that field // from `point` From ccbd7b29929b7a0e78e830a392f98fb469d22eb1 Mon Sep 17 00:00:00 2001 From: Kilian Date: Fri, 31 May 2024 10:55:39 +0200 Subject: [PATCH 2/2] changed comment --- src/custom_types/structs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/custom_types/structs.md b/src/custom_types/structs.md index ac7a039b71..f8f93eea5b 100644 --- a/src/custom_types/structs.md +++ b/src/custom_types/structs.md @@ -55,10 +55,10 @@ fn main() { // Make a new point by using struct update syntax to use the fields of our // other one - let bottom_right = Point { x: 5.2, ..point }; + let bottom_right = Point { x: 5.2, ..another_point }; - // `bottom_right.y` will be the same as `point.y` because we used that field - // from `point` + // `bottom_right.y` will be the same as `another_point.y` because we used that field + // from `another_point` println!("second point: ({}, {})", bottom_right.x, bottom_right.y); // Destructure the point using a `let` binding