diff options
Diffstat (limited to 'src/doc/book/listings/ch08-common-collections/listing-08-05/src/main.rs')
-rw-r--r-- | src/doc/book/listings/ch08-common-collections/listing-08-05/src/main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-05/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-05/src/main.rs new file mode 100644 index 000000000..783d9b110 --- /dev/null +++ b/src/doc/book/listings/ch08-common-collections/listing-08-05/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let v = vec![1, 2, 3, 4, 5]; + + let does_not_exist = &v[100]; + let does_not_exist = v.get(100); + // ANCHOR_END: here +} |