Rust loops: Difference between revisions
From wikinotes
(Created page with "= loop = <blockquote> <syntaxhighlight lang="rust"> loop { // loop forever } </syntaxhighlight> </blockquote><!-- loop -->") |
No edit summary |
||
Line 1: | Line 1: | ||
= Breaking/Continuing etc. = | |||
<blockquote> | |||
<syntaxhighlight lang="rust"> | |||
break; // exit loop | |||
continue; // skip to next iteration of loop | |||
</syntaxhighlight> | |||
</blockquote><!-- Breaking/Continuing etc. --> | |||
= loop = | = loop = | ||
<blockquote> | <blockquote> |
Revision as of 23:50, 6 February 2023
Breaking/Continuing etc.
break; // exit loop continue; // skip to next iteration of loop
loop
loop { // loop forever }