Convert Listing 8-1 to <Listing>

This commit is contained in:
SpectralPixel
2024-05-26 17:00:52 +02:00
parent f1e49bf7a8
commit 68c60cb014

View File

@@ -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.
<Listing number="8-1" caption="Creating a new, empty vector to hold values of type `i32`">
```rust
{{#rustdoc_include ../listings/ch08-common-collections/listing-08-01/src/main.rs:here}}
```
<span class="caption">Listing 8-1: Creating a new, empty vector to hold values
of type `i32`</span>
</Listing>
Note that we added a type annotation here. Because we arent inserting any
values into this vector, Rust doesnt know what kind of elements we intend to