diff --git a/src/control-flow-basics/break-continue/labels.md b/src/control-flow-basics/break-continue/labels.md index af198c4ecfe..27dbdd81dbc 100644 --- a/src/control-flow-basics/break-continue/labels.md +++ b/src/control-flow-basics/break-continue/labels.md @@ -6,17 +6,17 @@ to break out of nested loops: ```rust,editable fn main() { let s = [[5, 6, 7], [8, 9, 10], [21, 15, 32]]; - let mut found = false; + let mut elements_searched = 0; let target_value = 10; 'outer: for i in 0..=2 { for j in 0..=2 { + elements_searched += 1; if s[i][j] == target_value { - found = true; break 'outer; } } } - print!("{}", found) + print!("elements searched: {elements_searched}"); } ```