Add caption tags to the listings

This commit is contained in:
Carol (Nichols || Goulding) 2016-10-14 19:58:36 -04:00
parent 43a94644fa
commit d9cceb7365
2 changed files with 12 additions and 0 deletions

View File

@ -507,7 +507,9 @@ fn main() {
}
```
<caption>
Listing 2-3: Code changes needed in order to generate a random number
</caption>
We're adding a `extern crate rand;` line to the top that lets Rust know well be
using that external dependency. This also does the equivalent of calling `use
@ -602,7 +604,9 @@ fn main() {
}
```
<caption>
Listing 2-4: Handling the possible return values of comparing two numbers
</caption>
The first new bit here is another `use`, bringing a type called
`std::cmp::Ordering` into scope from the standard library. `Ordering` is
@ -1026,7 +1030,9 @@ fn main() {
}
```
<caption>
Listing 2-5: Complete code of the guessing game
</caption>
## Summary

View File

@ -526,7 +526,9 @@ fn main() {
}
```
<caption>
Listing 2-3: Code changes needed in order to generate a random number
</caption>
We're adding a `extern crate rand;` line to the top that lets Rust know well be
using that external dependency. This also does the equivalent of calling `use
@ -621,7 +623,9 @@ fn main() {
}
```
<caption>
Listing 2-4: Handling the possible return values of comparing two numbers
</caption>
The first new bit here is another `use`, bringing a type called
`std::cmp::Ordering` into scope from the standard library. `Ordering` is
@ -1049,7 +1053,9 @@ fn main() {
}
```
<caption>
Listing 2-5: Complete code of the guessing game
</caption>
## Summary