re: Which types of loops are most popular in the programming languages you use? VIEW POST

FULL DISCUSSION
 

In Rust it's quite a simple syntax:

for i in 1..100 {
    println!("{}", i);
}

And for Vec:

let mut nums: Vec<i32> = Vec::new();
nums.push(1);
nums.push(2);
nums.push(3);

for i in nums {
    println!("{}", i);
}

Same syntax for everything \o/

code of conduct - report abuse