break
break; exits the nearest enclosing loop.
Full reference: flow break.
Notes#
- Supported forms + diagnostics: flow break
Syntax#
break;
Example#
fn main () -> int {
let mut i: int = 0;
while true {
i += 1;
if i == 3 {
break;
}
}
return i;
}
See also#
- Full reference: flow break
continue: flow continue
Source repository · Edit this page · View Markdown