book/listings/ch08-common-collections/listing-08-06/src/main.rs

12 lines
183 B
Rust

fn main() {
// ANCHOR: here
let mut v = vec![1, 2, 3, 4, 5];
let first = &v[0];
v.push(6);
println!("The first element is: {first}");
// ANCHOR_END: here
}