Update nostarch file codeblocks to match src

This commit is contained in:
Carol (Nichols || Goulding) 2016-11-23 11:11:22 -05:00
parent de4ecc002e
commit effdfa3cda

View File

@ -88,7 +88,7 @@ fn area(length: u32, width: u32) -> u32 {
Lets try running this program with `cargo run`:
```bash
```text
The area of the rectangle is 1500 square pixels.
```
@ -222,7 +222,7 @@ fn main() {
If we run this, we get an error with this core message:
```bash
```text
error[E0277]: the trait bound `Rectangle: std::fmt::Display` is not satisfied
```
@ -238,7 +238,7 @@ want and structs do not have a provided implementation of `Display`.
If we keep reading the errors, though, well find this helpful note:
```bash
```text
note: `Rectangle` cannot be formatted with the default formatter; try using
`:?` instead if you are using a format string
```
@ -252,13 +252,13 @@ code.
Lets try running with this change and… drat. We still get an error:
```bash
```text
error: the trait bound `Rectangle: std::fmt::Debug` is not satisfied
```
Again, though, the compiler has given us a helpful note!
```bash
```text
note: `Rectangle` cannot be formatted using `:?`; if it is defined in your
crate, add `#[derive(Debug)]` or manually implement it
```
@ -285,7 +285,7 @@ fn main() {
At this point, if we run this program, we wont get any errors and well see
the following output:
```bash
```text
rect1 is Rectangle { length: 50, width: 30 }
```
@ -441,7 +441,7 @@ fn main() {
We want to see this output, since both of `rect2`s dimensions are smaller than
`rect1`s, but `rect3` is wider than `rect1`:
```bash
```text
Can rect1 hold rect2? true
Can rect1 hold rect3? false
```