diff options
Diffstat (limited to 'src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs')
-rw-r--r-- | src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs new file mode 100644 index 000000000..1b42274a6 --- /dev/null +++ b/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs @@ -0,0 +1,11 @@ +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 +} |