Please check the pinned topic and format your post accordingly.
This code doesn't "work", in that it doesn't do anything when run, as you can see in the playground. Compiler even hints you on the reason why. And by "doesn't do anything" I mean, literally - in release mode it compiles to nothing.
But at the top, you didn't save the iterator anywhere, or make it iterate, so it does nothing. You create a lazy, nested iterator and then throw it away. What you probably wanted:
for (index, number) in num_vec.iter().enumerate() {
println!("Index number {} has number {}", index, number);
}
Or
num_vec.iter().enumerate().for_each(|(index, number)| {
println!("Index number {} has number {}", index, number);
});
Both of these consume the iterator and make it iterate over all the values.