Why is an array not moved after the for block like a vector?
Advertisements I’m new to this language and am currently reading Rust in action. I understand why you’re able to access the vector after a for loop. However, I don’t understand why this works: let list = [1, 2, 3, 4, 5]; for item in list { println!("{}", item); } println!("{:#?}", list); If I try the… Read More Why is an array not moved after the for block like a vector?