]> git.proxmox.com Git - rustc.git/blob - src/doc/style/features/loops.md
New upstream version 1.12.1+dfsg1
[rustc.git] / src / doc / style / features / loops.md
1 % Loops
2
3 ### Prefer `for` to `while`. [FIXME: needs RFC]
4
5 A `for` loop is preferable to a `while` loop, unless the loop counts in a
6 non-uniform way (making it difficult to express using `for`).
7
8 ### Guidelines for `loop`. [FIXME]
9
10 > **[FIXME]** When is `loop` recommended? Some possibilities:
11 > * For optimistic retry algorithms
12 > * For servers
13 > * To avoid mutating local variables sometimes needed to fit `while`