fn main() {
let mut v = Vec::with_capacity(8);
// no reallocation = work faster
println!("A: {}", v.capacity());
v.push('a');
println!("B: {}", v.capacity());
v.push('b');
v.push('c');
v.push('d');
println!("C: {}", v.capacity());
v.push('e');
println!("D: {}", v.capacity());
}
/*
run:
A: 8
B: 8
C: 8
D: 8
*/