trpl-zh-cn/listings/ch08-common-collections/listing-08-07/src/main.rs
2022-02-06 16:43:51 +08:00

12 lines
185 B
Rust
Executable File

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
}