Can somebody explain what is going on in the following code; is it a bug or a language feature that the loops appear to exit early?
fn main() {
let mut y = 0.0;
let mut x = 0.0;
while y < 4.0 {
while x < 4.0 {
println!("{}, {}", x, y);
x+=1.0;
}
y+=1.0;
}
println!("{}, {}", x, y);
}
results in this output
0, 0
1, 0
2, 0
3, 0
4, 4