Skip to content

Commit

Permalink
Fixed some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
davidko authored Jul 11, 2016
1 parent 3ab8054 commit 81386cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/doc/book/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ could annotate it on the function declaration:

```rust,ignore
fn call_with_ref<'a, F>(some_closure:F) -> i32
where F: Fn(&'a 32) -> i32 {
where F: Fn(&'a i32) -> i32 {
```

However this presents a problem with in our case. When you specify the explicit
Expand All @@ -350,7 +350,7 @@ of the closure we can use Higher-Ranked Trait Bounds with the `for<...>` syntax:

```ignore
fn call_with_ref<F>(some_closure:F) -> i32
where F: for<'a> Fn(&'a 32) -> i32 {
where F: for<'a> Fn(&'a i32) -> i32 {
```

This lets the Rust compiler find the minimum lifetime to invoke our closure and
Expand Down

0 comments on commit 81386cf

Please sign in to comment.