Skip to content

Commit b1bb69f

Browse files
committed
Chapter 6 - Wrap all <Listing>s to comply with the virtual 80 character limit (READ DESC.)
I'm unsure whether wrapping the text may cause the listing text to be wrapped too as the newlines are found within quotation marks. If it causes issues, feel free to revert this commit. Another odd thing is that my editor uncolored the closing `</Listing>` tag when I split the lines. Maybe the newline characters need to be escaped with a backslash?
1 parent 0b339ad commit b1bb69f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/ch06-01-defining-an-enum.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ only know what *kind* it is. Given that you just learned about structs in
5959
Chapter 5, you might be tempted to tackle this problem with structs as shown in
6060
Listing 6-1.
6161

62-
<Listing number="6-1" caption="Storing the data and `IpAddrKind` variant of an IP address using a `struct`">
62+
<Listing number="6-1" caption="Storing the data and `IpAddrKind` variant of an
63+
IP address using a `struct`">
6364

6465
```rust
6566
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs:here}}
@@ -141,7 +142,8 @@ more about bringing types into scope in Chapter 7.
141142
Let’s look at another example of an enum in Listing 6-2: this one has a wide
142143
variety of types embedded in its variants.
143144

144-
<Listing number="6-2" caption="A `Message` enum whose variants each store different amounts and types of values">
145+
<Listing number="6-2" caption="A `Message` enum whose variants each store
146+
different amounts and types of values">
145147

146148
```rust
147149
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs:here}}

src/ch06-02-match.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function that takes an unknown US coin and, in a similar way as the counting
2222
machine, determines which coin it is and returns its value in cents, as shown
2323
in Listing 6-3.
2424

25-
<Listing number="6-3" caption="An enum and a `match` expression that has the variants of the enum as its patterns">
25+
<Listing number="6-3" caption="An enum and a `match` expression that has the
26+
variants of the enum as its patterns">
2627

2728
```rust
2829
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs:here}}
@@ -76,7 +77,8 @@ designs, so only quarters have this extra value. We can add this information to
7677
our `enum` by changing the `Quarter` variant to include a `UsState` value
7778
stored inside it, which we’ve done in Listing 6-4.
7879

79-
<Listing number="6-4" caption="A `Coin` enum in which the `Quarter` variant also holds a `UsState` value">
80+
<Listing number="6-4" caption="A `Coin` enum in which the `Quarter` variant
81+
also holds a `UsState` value">
8082

8183
```rust
8284
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs:here}}
@@ -121,7 +123,8 @@ operations.
121123
This function is very easy to write, thanks to `match`, and will look like
122124
Listing 6-5.
123125

124-
<Listing number="6-5" caption="A function that uses a `match` expression on an `Option<i32>`">
126+
<Listing number="6-5" caption="A function that uses a `match` expression on an
127+
`Option<i32>`">
125128

126129
```rust
127130
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs:here}}

src/ch06-03-if-let.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ program in Listing 6-6 that matches on an `Option<u8>` value in the
66
`config_max` variable but only wants to execute code if the value is the `Some`
77
variant.
88

9-
<Listing number="6-6" caption="A `match` that only cares about executing code when the value is `Some`">
9+
<Listing number="6-6" caption="A `match` that only cares about executing code
10+
when the value is `Some`">
1011

1112
```rust
1213
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs:here}}

0 commit comments

Comments
 (0)