From 68c60cb01498345bed2a01ff7609fa0aa9ffd871 Mon Sep 17 00:00:00 2001 From: SpectralPixel Date: Sun, 26 May 2024 17:00:52 +0200 Subject: [PATCH] Convert Listing 8-1 to `` --- src/ch08-01-vectors.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ch08-01-vectors.md b/src/ch08-01-vectors.md index ece5d59dc..40793ad35 100644 --- a/src/ch08-01-vectors.md +++ b/src/ch08-01-vectors.md @@ -11,12 +11,13 @@ lines of text in a file or the prices of items in a shopping cart. To create a new empty vector, we call the `Vec::new` function, as shown in Listing 8-1. ++ ```rust {{#rustdoc_include ../listings/ch08-common-collections/listing-08-01/src/main.rs:here}} ``` -Listing 8-1: Creating a new, empty vector to hold values -of type `i32` + Note that we added a type annotation here. Because we aren’t inserting any values into this vector, Rust doesn’t know what kind of elements we intend to