Skip to content

Commit

Permalink
Fix up <Listing> usage in Ch. 18
Browse files Browse the repository at this point in the history
Thanks to @LifeAdventurer (<[email protected]>) for flagging
this up on the tracking issue!
  • Loading branch information
chriskrycho committed Oct 15, 2024
1 parent b28a2f6 commit 1d595d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ch18-01-what-is-oo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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}}
Expand Down

0 comments on commit 1d595d8

Please sign in to comment.