loop

The loop statement just loops forever, until a break.

  1. fn main() {
  2. let mut i = 0;
  3. loop {
  4. i += 1;
  5. println!("{i}");
  6. if i > 100 {
  7. break;
  8. }
  9. }
  10. }