Closed
Description
This code works:
fn main() {
for i in range(0, 256) {
println(i.to_str());
}
}
but this code doesn't:
fn main() {
for i in range(255, -1) {
println(i.to_str());
}
}
The compiler shows no warnings or errors and the executable produces no output:
[jesse@localhost ~]$ rustc nums.rs
[jesse@localhost ~]$ ./nums
[jesse@localhost ~]$
It seems to me that range(a, b)
should work for both cases, a < b
and a > b
.
Metadata
Metadata
Assignees
Labels
No labels