78cde5b9fb
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
9 lines
132 B
Rust
9 lines
132 B
Rust
pub fn main() {
|
|
let mut x = 0;
|
|
do 4096.times {
|
|
x += 1;
|
|
}
|
|
assert_eq!(x, 4096);
|
|
printfln!("x = %u", x);
|
|
}
|