Skip to content

Commit 64feba0

Browse files
committed
Updated based on CR feedback.
1 parent 7da9ea0 commit 64feba0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/book/closures.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ fn call_with_ref<F>(some_closure:F) -> i32
334334
Normally you can specify the lifetime of the parameter to our closure. We
335335
could annotate it on the function declaration:
336336

337-
```
337+
```ignore
338338
fn call_with_ref<'a, F>(some_closure:F) -> i32
339339
where F: Fn(&'a 32) -> i32 {
340340
```
@@ -348,12 +348,12 @@ to compile.
348348
In order to say that we only need the lifetime to be valid for the invocation scope
349349
of the closure we can use Higher-Ranked Trait Bounds with the `for<...>` syntax:
350350

351-
```
351+
```ignore
352352
fn call_with_ref<F>(some_closure:F) -> i32
353353
where F: for<'a> Fn(&'a 32) -> i32 {
354354
```
355355

356-
This lets the rust compiler find the minimum lifetime to invoke our closure and
356+
This lets the Rust compiler find the minimum lifetime to invoke our closure and
357357
satisfy the borrow checker's rules. Our function then compiles and excutes as we
358358
expect.
359359

0 commit comments

Comments
 (0)