Loops

Rust has essentially three types of loops:

  • loop is the simplest one—it just goes through a block of code again and again until one of the loop-breaking keywords is used
  • while is like loop, but with a condition—the block of code is looped again and again as long as the condition is true
  • for is different from the above two—it is for iterating through sequences
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset