What if we wanted a conditional loop without any break?

while loop

"while the condition is met (i.e. returns true), run the specified code"

Like for if blocks, conditions are boolean expressions

while

Example:


            fn main(){
                let mut counter = 3;

                while counter > 0 {
                    println!("{counter}...");
                    counter -= 1;
                }

                println!("GO!");
            }
        

Is there a safer, more concise way to write the previous example?

Yes! By using a...