]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / doc / book / listings / ch08-common-collections / listing-08-06 / src / main.rs
index 783d9b110f1b6e3b0d7b9a8d8666927e2e910f58..1b42274a6dd0e47bb34b218d2eb9e692db654589 100644 (file)
@@ -1,8 +1,11 @@
 fn main() {
     // ANCHOR: here
-    let v = vec![1, 2, 3, 4, 5];
+    let mut v = vec![1, 2, 3, 4, 5];
 
-    let does_not_exist = &v[100];
-    let does_not_exist = v.get(100);
+    let first = &v[0];
+
+    v.push(6);
+
+    println!("The first element is: {}", first);
     // ANCHOR_END: here
 }