From f42cb5718c647d00364a38e297ae4a54e477dabb Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sun, 25 Aug 2024 04:02:39 +0000 Subject: [PATCH] Update Examples --- Examples.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Examples.md b/Examples.md index aee6656..4ac7181 100644 --- a/Examples.md +++ b/Examples.md @@ -833,11 +833,36 @@ fn main ``` +fn main() { + let mut counter = 0; + let result = loop { + counter += 1; + + if counter == 10 { + break counter * 2; + } + }; + + assert_eq!(result, 20); +} ``` ``` +fn main + let mut counter = 0 + + let result = loop + counter += 1 + + if counter == 10 then break counter * 2 + + assert_eq! result, 20) + + + + ```