len — number of elements. capacity — allocated space.
len:
capacity:
1let mut v = Vec::with_capacity(10);2v.push(1);3v.push(2);4println!("len: {}, cap: {}", v.len(), v.capacity());5// len: 2, cap: 10
Key: len for elements, capacity for allocated space.