From 8747efb5db94df33446f0121223fbe2795973a32 Mon Sep 17 00:00:00 2001 From: Annlix Date: Wed, 13 Oct 2021 09:20:37 +0800 Subject: [PATCH] Fixed a sytax error in ch03-05 At line 286, the correct sytax of `break` is `break 'counting_up;`, not `break'counting_up;`. --- src/ch03-05-control-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch03-05-control-flow.md b/src/ch03-05-control-flow.md index 86b7c51..d893272 100644 --- a/src/ch03-05-control-flow.md +++ b/src/ch03-05-control-flow.md @@ -283,7 +283,7 @@ fn main() { } ``` -外层循环有一个标签 `counting_up`,它将从 0 数到 2。没有标签的内部循环从 10 向下数到 9。第一个没有指定标签的 `break` 将只退出内层循环。`break'counting_up;` 语句将退出外层循环。这个代码打印: +外层循环有一个标签 `counting_up`,它将从 0 数到 2。没有标签的内部循环从 10 向下数到 9。第一个没有指定标签的 `break` 将只退出内层循环。`break 'counting_up;` 语句将退出外层循环。这个代码打印: ```console $ cargo run