continue
continue; skips the remainder of the current loop body and advances to the
next iteration.
Full reference: flow continue.
Notes#
- Supported forms + diagnostics: flow continue
Syntax#
continue;
Example#
fn main () -> int {
let mut sum: int = 0;
for i in 0..5 {
if i == 3 {
continue;
}
sum += i;
}
return sum; // 0 + 1 + 2 + 4 = 7
}
See also#
- Full reference: flow continue
break: flow break
Source repository · Edit this page · View Markdown