mirror of
https://github.com/rust-lang/book.git
synced 2026-05-18 05:32:16 -04:00
fix the build
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user