|
|
|
|
|
by pron
1999 days ago
|
|
> and I find it's much easier to forget the ++i at the end of the while loop. You can do: var i: usize = 0;
while (i < 10) : (i += 1) {
...
}
or var i: usize = 0;
while (i < 10) {
defer i += 1;
...
}
although the two have slightly different semantics (the latter would increment even after a break; the former wouldn't). |
|