We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32fb252 commit 8483732Copy full SHA for 8483732
src/doc/book/closures.md
@@ -511,12 +511,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
511
Box::new(|x| x + num)
512
}
513
514
-# fn main() {
515
let f = factory();
516
517
let answer = f(1);
518
assert_eq!(6, answer);
519
-# }
520
```
521
522
There’s just one last problem:
@@ -542,12 +540,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
542
540
Box::new(move |x| x + num)
543
541
544
545
546
547
548
549
550
551
552
553
By making the inner closure a `move Fn`, we create a new stack frame for our
0 commit comments