mirror of
https://github.com/rust-lang/book.git
synced 2026-05-16 18:30:39 -04:00
Merge pull request #4069 from rust-lang/ch18-listing-fixup
Fix up `<Listing>` usage in Ch. 18
This commit is contained in:
@@ -44,7 +44,7 @@ on demand whenever anyone needs it. In other words, `AveragedCollection` will
|
||||
cache the calculated average for us. Listing 18-1 has the definition of the
|
||||
`AveragedCollection` struct:
|
||||
|
||||
<Listing number="18-1" file-name="src/lib.rs" caption="Listing 18-1: An `AveragedCollection` struct that maintains a list of integers and the average of the items in the collection">
|
||||
<Listing number="18-1" file-name="src/lib.rs" caption="An `AveragedCollection` struct that maintains a list of integers and the average of the items in the collection">
|
||||
|
||||
```rust,noplayground
|
||||
{{#rustdoc_include ../listings/ch18-oop/listing-18-01/src/lib.rs}}
|
||||
@@ -58,9 +58,7 @@ ensure that whenever a value is added or removed from the list, the average is
|
||||
also updated. We do this by implementing `add`, `remove`, and `average` methods
|
||||
on the struct, as shown in Listing 18-2:
|
||||
|
||||
<Listing number="18-2" file-name="src/lib.rs" caption="Listing 18-2: Implementations of the public methods `add`, `remove`, and `average` on `AveragedCollection`">
|
||||
|
||||
<span class="filename">Filename: src/lib.rs</span>
|
||||
<Listing number="18-2" file-name="src/lib.rs" caption="Implementations of the public methods `add`, `remove`, and `average` on `AveragedCollection`">
|
||||
|
||||
```rust,noplayground
|
||||
{{#rustdoc_include ../listings/ch18-oop/listing-18-02/src/lib.rs:here}}
|
||||
|
||||
Reference in New Issue
Block a user