What is the simplest form of initializing an array with consecutive integers from 0 to N?
I have this code, but I think idiomatic Rust will look much simpler:
const NUM: u32 = 8;
fn main() {
let mut int_list: [u32; NUM as usize] = [0; NUM as usize];
for i in 0..NUM {
int_list[i as usize] = i;
}
println!("data: {:?}", int_list);
}