From 19b452f584c43c72afae18b1642814d904da3ae2 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sat, 24 Aug 2024 04:23:23 +0000 Subject: [PATCH] Update Examples --- Examples.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Examples.md b/Examples.md index f4f33db..7169908 100644 --- a/Examples.md +++ b/Examples.md @@ -281,6 +281,9 @@ struct Rectangle top_left: Point bottom_right: Point + + + fn main() // Create struct with field init shorthand let name = s"Peter" // note s-string @@ -299,7 +302,7 @@ fn main() println! "second point: ({}, {})", bottom_right.x, bottom_right.y // Destructure the point using a `let` binding - let Point x: left_edge, y: top_edge = point; + let Point x: left_edge, y: top_edge = point let _rectangle = Rectangle top_left: Point @@ -313,7 +316,7 @@ fn main() println! "pair contains {:?} and {:?}", pair.0, pair.1 // Destructure a tuple struct - let Pair integer, decimal = pair; + let Pair integer, decimal = pair println! "pair contains {:?} and {:?}", integer, decimal