We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1958e39 + 81386cf commit 23d5f56Copy full SHA for 23d5f56
src/doc/book/closures.md
@@ -336,7 +336,7 @@ could annotate it on the function declaration:
336
337
```rust,ignore
338
fn call_with_ref<'a, F>(some_closure:F) -> i32
339
- where F: Fn(&'a 32) -> i32 {
+ where F: Fn(&'a i32) -> i32 {
340
```
341
342
However this presents a problem with in our case. When you specify the explicit
@@ -350,7 +350,7 @@ of the closure we can use Higher-Ranked Trait Bounds with the `for<...>` syntax:
350
351
```ignore
352
fn call_with_ref<F>(some_closure:F) -> i32
353
- where F: for<'a> Fn(&'a 32) -> i32 {
+ where F: for<'a> Fn(&'a i32) -> i32 {
354
355
356
This lets the Rust compiler find the minimum lifetime to invoke our closure and
0 commit comments