fix the build

This commit is contained in:
steveklabnik
2018-07-17 12:32:14 -04:00
parent 6f1bafe26c
commit e38f07d8d7
2 changed files with 3 additions and 1 deletions

View File

@@ -193,7 +193,7 @@ In Chapter 13, we'll learn about closures. The `Result<T, E>` type has many
methods that accept a closure, and are implemented as `match` statements. A more
seasoned Rustacean might write this:
```rust
```rust,ignore
use std::fs::File;
use std::io::ErrorKind;

View File

@@ -453,6 +453,7 @@ struct StrWrap<'a>(&'a str);
We can write a function that returns one of these like this:
```rust
# struct StrWrap<'a>(&'a str);
fn foo<'a>(string: &'a str) -> StrWrap<'a> {
StrWrap(string)
}
@@ -462,6 +463,7 @@ But that's a lot of `'a`s! To cut down on some of this noise, we can use the
anonymous lifetime, `'_`, like this:
```rust
# struct StrWrap<'a>(&'a str);
fn foo(string: &str) -> StrWrap<'_> {
StrWrap(string)
}