Skip to main content

One doc tagged with "while"

View all tags

Loops: `while` loops

In the previous article, we learned how to create infinite loops with the loop keyword. While loop is useful, it's often more common to loop while a certain condition is true. For this, Rust provides the while loop.