diff --git a/src/ch09-02-recoverable-errors-with-result.md b/src/ch09-02-recoverable-errors-with-result.md
index 523ee8371..e3013105b 100644
--- a/src/ch09-02-recoverable-errors-with-result.md
+++ b/src/ch09-02-recoverable-errors-with-result.md
@@ -562,7 +562,7 @@ error message. /Carol -->
When we compile this, we get the following error message:
-```bash
+```text
error[E0308]: mismatched types
-->
|
diff --git a/src/ch12-04-testing-the-librarys-functionality.md b/src/ch12-04-testing-the-librarys-functionality.md
index 9fb46d790..1eda846a6 100644
--- a/src/ch12-04-testing-the-librarys-functionality.md
+++ b/src/ch12-04-testing-the-librarys-functionality.md
@@ -191,7 +191,7 @@ vector:
Filename: src/lib.rs
-```rust,ignore
+```rust
fn grep<'a>(search: &str, contents: &'a str) -> Vec<&'a str> {
let mut results = Vec::new();
diff --git a/src/ch12-06-writing-to-stderr-instead-of-stdout.md b/src/ch12-06-writing-to-stderr-instead-of-stdout.md
index 8fff0a25a..e12d5416d 100644
--- a/src/ch12-06-writing-to-stderr-instead-of-stdout.md
+++ b/src/ch12-06-writing-to-stderr-instead-of-stdout.md
@@ -19,7 +19,7 @@ The `>` syntax tells the shell to write the contents of standard out to
running we'll see our error message:
```text
-Application error: No search string or filename found
+Problem parsing arguments: not enough arguments
```
We'd like this to be printed to the screen instead, and only have the output
@@ -34,19 +34,25 @@ extern crate greprs;
use std::env;
use std::process;
+use std::io::prelude::*;
use greprs::Config;
fn main() {
+ let mut stderr = std::io::stderr();
let args: Vec = env::args().collect();
let config = Config::new(&args).unwrap_or_else(|err| {
- println!("Problem parsing arguments: {}", err);
+ writeln!(
+ &mut stderr,
+ "Problem parsing arguments: {}",
+ err
+ ).expect("Could not write to stderr");
+
process::exit(1);
});
if let Err(e) = greprs::run(config) {
- let mut stderr = std::io::stderr();
writeln!(
&mut stderr,
@@ -82,7 +88,7 @@ redirecting `stdout` with `>`:
```text
$ cargo run > output.txt
-Application error: No search string or filename found
+Problem parsing arguments: not enough arguments
```
Now we see our error on the screen, but `output.txt` contains nothing. If we