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
https://play.rust-lang.org/?gist=0eff20c7654539063ee2faa09f38bed6&version=stable&mode=debug